Processing資料(4) アニメーション
6
アニメーション Processing資料(4)
-
Upload
reona396 -
Category
Technology
-
view
130 -
download
1
Transcript of Processing資料(4) アニメーション
アニメーション
Processing資料(4)
円が動くアニメーション
int x = 0;
void setup() { size(400, 400); background(255,255,255);}
void draw() { background(255, 255, 255); ellipse(x, 200, 50, 50); x++;}
ループさせる
画面の端まで動いたら 反対の端から出てくる
void draw() { background(255, 255, 255);
ellipse(x, height/2, r, r);
x++;
if (x > width) { x = 0; }}
int r = 50;int x = 0;
void setup() { size(400, 400); background(255, 255, 255);}
void draw() { background(255, 255, 255);
ellipse(x, height/2, r, r); x++;
if (x > width + r/2) { x = -r/2; }}
int r = 50;int x = -r/2;
void setup() { size(400, 400); background(255, 255, 255);}
なめらかにループさせる
例題
画面の端まで動いたら反対方向へはねかえる円