Processing with JS?Processing.js? 什麼鬼東西??
國外網站近日放出這個JS Library。
 主要功能讓HTML載入這個JS檔之後可以在網頁裡使用Processing Code。
 一定很多人會問:Processing本來就可以Export出JavaApplet了啊!!!!

先來看個兩三個範例吧

Ex1. Snake follows your cursor



Ex2. Soft Body follows your cursor




或許以上兩個範例看起來跟 Processing 中的範例直接輸出 Applet 丟到網頁上沒啥兩樣,

但是仔細看看網頁的原始碼,你會發現:Processing Code 通通跑到 <script> 標籤中啦!!!

以後寫 Processing 不但不用等編譯時間,甚至還不用輸出成 Applet 才能放到網頁上咧~

看到了嗎??標籤類型是~~~~~~ <script type="application/processing">



運作的模式大概就是:
1. 包進兩個 JS 檔到網頁中 processing.jsinit.js
2. 網頁中要有個 Canvas 供 Processing 使用

其他請參照上兩個範例的原始碼。


Proccessing官方範例頁面
http://processingjs.org/learning/basic

 

======== DK  Misty 分隔線 ================

以下原文轉貼:

Processing.js Aftermath [John Resig blog]

That’s sad. Because if "Java" remains a four-letter word (erm … well, you know what I mean), it really will be a massive blow to the open future of rich client media.

The Reality

Processing in Java is …

  • Extensible (you can easily add Java libraries to add features)
  • Massively compatible (you need only Java 1.3 or later, which believe it or not is already on the majority of machines — on CDM, we see roughly the same penetration as we do for Flash)
  • Fast (significantly faster than JavaScript for processor-intensive operations)
  • 3D
  • Functional in the browser and as desktop software on every platform
  • Compatible with desktop features (hardware support, MIDI, synthesis, audio, video … see the extensible bit)

Processing in JavaScript is …

  • Limited to JavaScript’s capabilities — and thus not nearly as extensible
  • Massively incompatible (IE7 doesn’t work at all. Firefox 3 is recommended, even though it’s not out yet.)
  • Slow, often unstable, and CPU-hungry
  • Browser-only
  • Loses all desktop functionality (hardware support is significantly less than what you get with Flash)
arrow
arrow
    全站熱搜

    DK 發表在 痞客邦 留言(0) 人氣()