/** * a spinning rectangle by Guru */ void setup() { size(300,300); smooth(); frameRate(25); } float a = 0; void draw() { fill(255, 20); noStroke(); rect(0,0,width, height ); stroke( 0 ); noFill(); a += 0.05; pushMatrix(); translate( width/2, height/2 ); rotate( a ); float w = abs(200 * sin(a)) + 5; rect( -w/2,-w/2,w,w ); popMatrix(); }