Thursday, June 25, 2009
Spiralling rotating square
int i = 0;
void setup()
{
background(255);
smooth();
size(600,600);
frameRate(20);
}
void draw()
{
pushMatrix();
noFill();
stroke(100 + (sin(radians(i)) * 100), 40);
translate(sin(radians(i)) * (i / 2) + (width / 2), cos(radians(i)) * (i / 2) + (height/2));
rotate(i);
rect(0, 0, i%600, i%600);
popMatrix();
i++;
}
void mousePressed()
{
background(255);
i=0;
}
void setup()
{
background(255);
smooth();
size(600,600);
frameRate(20);
}
void draw()
{
pushMatrix();
noFill();
stroke(100 + (sin(radians(i)) * 100), 40);
translate(sin(radians(i)) * (i / 2) + (width / 2), cos(radians(i)) * (i / 2) + (height/2));
rotate(i);
rect(0, 0, i%600, i%600);
popMatrix();
i++;
}
void mousePressed()
{
background(255);
i=0;
}
info
submitted by:
jon_stuttersviews: 1824
A sketch based on <A href="http://www.sketchpatch.net/view/E7N1OWhsfVR/">Hello World by subflux</A> with even more rotating and some alpha blending.

comments

Add a comment: