xxxxxxxxxx
void setup()
{
size (500, 500);
background (0);
}
int time = 0;
void draw()
{
float m = map(millis(), 0, 60, 0, 2*PI);
float x = cos(millis()/200.0);
float y = sin(millis()/200.0);
colorMode(HSB, 360, 100, 100);
time = time+1;
if (time < 2000 )
{
rectMode(CENTER);
translate(width/2, height/2);
rotate(m/100.0);
float l = map(y, -1, 1, 0, 360);
noStroke();
fill(l, 20, 100, 100);
rect(x*100, y*200, x*50, y*100);
}
else{
translate(250, 250);
rotate(m/100.0);
noStroke();
float h = map(y, -1, 1, 0, 360);
fill(h, 360, 100, 100);
ellipse(y*100, 150, x*5, x*10);
}
}