아두이노_프로세싱/프로세싱
프로세싱 이동하는 사각형 그리기
돌돌쌤
2012. 7. 11. 22:45
프로세싱 이동하는 사각형 그리기
소스스케치
---------------------------------------------------------------
int a = 0;
float b = 0.0;
float c = 0.0;
void setup(){
size(480,320);
background(255);
noStroke();
}
void draw(){
background(255);
a=a+1;
b=b+1.8;
c=c+2.7;
fill(a,b,a,100);
rect(a,0,30,height/3); // 사각형 그리기
fill(b,a,c,100);
rect(b, height/3,30,height/3);
fill(c,c,255-a,100);
rect(c,(height*2)/3,30,height/3);
if(a>width){a= 0;}
if(b>width){b= 0;}
if(c>width){c= 0;}
}
--------------------------------------------------------------
프로세싱 레퍼런스 http://processing.org/reference/
rect(x, y, width, height)
noStroke()