このウィキの読者になる
更新情報がメールで届きます。
このウィキの読者になる
カテゴリー
最近更新したページ
2011-12-05
2010-02-05
2008-01-31
2007-12-09
2007-11-22
2007-11-04
2007-10-06
2007-05-17
2007-05-13
2007-05-11
2007-05-10
最新コメント
1-14 by awesome things!
117 by stunning seo guys
Processing4 Data by stunning seo guys
送信ボタンの仕組み by stunning seo guys
511 by stunning seo guys
510 by music production software
ProStr by awesome things!
FrontPage by check it out
CSV形式とは by check it out
Menu

Push and Pop

/**
* Push Pop. * * The push() and pop() functions allow for more control over transformations. * The push function saves the current coordinate system to the stack * and pop() restores the prior coordinate system. * * Created 26 October 2002 */
float a; // Angle of rotation
float offset = PI/24; // Angle offset between boxes
int num = 12; // Number of boxes
color[] colors = new color[num]; // Colors of each box
color safecolor;

boolean pink = true;

void setup()
{
size(200, 200, P3D); noStroke(); frameRate(30); safecolor = color(153, 153, 153); for(int i=0; i<num; i++) { colors[i] = color(255 * (i+1)/num, 153 * (num-i)/num, 204); } lights();
}

void draw()
{
background(0, 0, 26); translate(width/2, height/2, -20); a+=0.04; if(a >= TWO_PI*2) { a = 0.0; } for(int i=0; i<num; i++) { pushMatrix(); fill(colors[i]); rotateY(a+offset*i); rotateX(a/2+offset*i); box(width/2); popMatrix(); }
}
2006年11月30日(木) 11:58:51 Modified by ID:hElD8hu5PA




スマートフォン版で見る