Saturday, June 06, 2009
Gradient Rotating Square 8
// just type here
// and click "submit" when done
int i = 0;
void setup()
{
background(255);
smooth();
size(600,600);
}
void draw()
{
i++;
noFill();
stroke(100 + i%55 + random(1,100), 100 + i%55 + random(1,100), 100 + i%55 + random(1,100));
translate(300,300);
rotate(i/100);
translate( - ((i%600) / 2), - ((i%600) / 2));
rect(0, 0, i%600, i%600);
}
void mousePressed()
{
background(255);
}
// and click "submit" when done
int i = 0;
void setup()
{
background(255);
smooth();
size(600,600);
}
void draw()
{
i++;
noFill();
stroke(100 + i%55 + random(1,100), 100 + i%55 + random(1,100), 100 + i%55 + random(1,100));
translate(300,300);
rotate(i/100);
translate( - ((i%600) / 2), - ((i%600) / 2));
rect(0, 0, i%600, i%600);
}
void mousePressed()
{
background(255);
}
info
submitted by: DARYL_Gammaniiiice. So, this one draws the border of a square in different colors as it rotates and grows in the middle of the canvas.
This sketch has a parent
comments
loading...
sign in to Add a comment: