このウィキの読者になる
更新情報がメールで届きます。
このウィキの読者になる
カテゴリー
最近更新したページ
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

Embe PP

/**

* Embedding Push Pop

* by Chris Noessel.

*

* Embedding pop() and push() within a for() loop.

*

* Created 9 December 2002

*/



int xgridcount = 4;

int ygridcount = 4;

int zgridcount = 4;

int halfx = xgridcount / 2;

int halfy = ygridcount / 2;

int halfz = zgridcount / 2;

float a = 0.0;

float boxsize = 0;

int gDistance;


void setup()

{

size(200, 200, P3D);

noStroke();

colorMode(HSB, 100);

gDistance = width - width/4;

}



void draw()

{

background(51);


translate(halfx*gDistance -gDistance, halfy*gDistance -gDistance,-gDistance *10);


// First number is pauses between timechange,

// lower 2nd number = faster speed

a += abs(sin(millis()/1500)/500);


for(int i=halfx *-1; i<=halfx; i+=1) {

translate(gDistance, 0, 0);

rotateX(a*.9);


pushMatrix();

for(int j=halfy *-1; j<= halfy; j+=1){

translate(-width/2, gDistance, 0);

rotateZ(a*1.1);

pushMatrix();

for(int k=halfz * -1; k<= halfz; k+=1){

translate(0, 0, gDistance);

rotateY(a);


boxsize = 30 + (sin(i*j*k*a) *(gDistance)*1.66);


fill(0, 0, 100-boxsize/5.1);

box(boxsize, boxsize, boxsize);

}

popMatrix();

}

popMatrix();

}

}
2006年11月30日(木) 12:02:13 Modified by ID:hElD8hu5PA




スマートフォン版で見る