> proce55ing > proce55ing plactice01

proce55ing plactice01

  • Posted by: yuta
  • 2007年10月16日 19:29
  • proce55ing

p5_plactice01.jpg

proce55ing / plactice01

バリバリの初心者ですが今更proce55ingの練習など…。

Source code: plactice01
.........................................................................

float xx , yy; //位置
float Cx , Cy; //中心
float Angle; //角度
float R; //半径

void setup(){
size(500,500);
background(0);
colorMode(RGB,256);
noStroke();
frameRate(30);

Cx = width / 2;
Cy = height / 2;
Angle = 60;
R = 360;
}

void draw(){
fadeToWhite();

Angle += 3;
xx = Cx + (R * sin(radians(Angle)) );
yy = Cy + (R * cos(radians(Angle)) );

int x = int(random(width));
int y = int(random(height));
int sz = int(random(40));
int angle = 1;
int x_margin = 1;

translate(-150,460);

for(int i=680 ; i > 0 ; i--){

fill(randomRGBColor());
smooth();
pushMatrix();
translate(i*x_margin,150-i);
rotate(radians(i*angle));
rect(xx,yy,sz/10,sz/10);
popMatrix();
}
}

color randomRGBColor(){
color c = color(random(256),random(256),random(256));
return c;
}

void fadeToWhite(){
rectMode(CORNER);
fill(0,2);
rect(0,0,width,height);
}

参考 : Built with Processingデザイン/アートのためのプログラミング入門

Comments:0

Comment Form

コメントを表示する前にこのブログのオーナーの承認が必要になることがあります。

> proce55ing > proce55ing plactice01

Links
Search
Feeds

Return to page top