Transform: rotating squares
Filed under: sketches
void setup() {
size(300, 300);
}
void draw() {
background(0);
fill(255);
noStroke();
smooth();
frameRate(30);
pushMatrix();
translate(width/2, height/2);
rotate(TWO_PI/30 * frameCount%60 * 0.5);
//println(TWO_PI/30 * frameCount%60 * 0.5);
rectMode(CENTER);
rect(0, 0, 150, 150);
popMatrix();
pushMatrix();
translate(width/2, height/2);
rotate(-TWO_PI/30 * frameCount%30);
fill(255, 0, 255);
rect(0, 0, 50, 50);
popMatrix();
}
bene posted on April 10th, 2008
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed