사용자 삽입 이미지

void setup() {
size(400,200);
noStroke( );
smooth();
background(0);
}
float randomColor = random(0,360);
int cplus=1;
float randomR = random(0,90);
float offset= 100;
float scaleVal = 90;
float angleInc=PI/18.0;
float angle = 0.0;

void draw () {

randomColor = randomColor + cplus;
if ( (randomColor<0) || (randomColor)>360)
cplus=-cplus;

for (int x = 0; x <= width ; x += 10 ){
float y = offset + (sin(angle) * scaleVal);
fill(255);
ellipse(x,y,7,7);
y = offset + (cos(angle)*scaleVal);
fill(randomColor,100,100);
ellipse(x,y,7,7);
angle += angleInc;

}
}
Posted by 알 수 없는 사용자