Matrix Manipulation
Filed under: sketches
float angle;
void setup() {
size(600, 600);
smooth();
}
void draw() {
background(200);
pushMatrix();
// moves origin to center of screen
translate(width/2, height/2);
rotate(frameCount * 0.01);
scale(frameCount%200 * 0.01);
angle = 0;
for(int i=0; i<10; i++) {
pushMatrix();
rotate(angle);
line (width/2 - 20, 0, width/2, frameCount%200*3);
ellipse(width/2 - 20, 0, 30, 30);
popMatrix();
angle += TWO_PI / 10;
}
popMatrix();
}
bene posted on April 8th, 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