prosessing の例
- http://red-treasure.com/report/?p=209
> > コスミー報告書[社外秘] - Javascriptのすごいライブラリみつけた Processing.js
このページにある Prosessing の サンプルを action-coding 用に変更してみた。
xfy 画面中で Processing で生成した画像、アプリを表示するようにするにはどうしたらよいだろう...
$ cat cat sample000.rb
# See http://red-treasure.com/report/?p=209
def setup
size(200, 200)
smooth
noStroke()
fill(255, 153)
@num = 60
@mx = []
@my = []
for i in 1..@num
@mx[i-1], @my[i-1] = 0, 0
end
end
def draw
background(51)
# Reads throught the entire array
# and shifts the values to the left
for i in 1..@num
@mx[i-1], @my[i-1] = @mx[i], @my[i]
end
# Add the new values to the end of the array
@mx[@num-1], @my[@num-1] = mouseX, mouseY
@mx[@num-1] = 0 if @mx[@num-1] == nil
@my[@num-1] = 0 if @my[@num-1] == nil
for i in 1..@num
ellipse(@mx[i-1], @my[i-1], i/2, i/2)
end
end
« あし@ でのカテゴリー中でのランキングが、2位になった | トップページ | ピックアップ:見えるグーグル、見えないグーグル, Mac OSX同士でクリップボードを共有する, etc... »
この記事へのコメントは終了しました。
« あし@ でのカテゴリー中でのランキングが、2位になった | トップページ | ピックアップ:見えるグーグル、見えないグーグル, Mac OSX同士でクリップボードを共有する, etc... »
コメント