float ang; void setup() { size (200,200); background (255); framerate (50); rectMode(CENTER); } void draw () { background (255); stroke(0,0,0,50);//color of red square translate (100,100);//move origin of red square line(0,-width, 0, width);// draw vertical line line(-height, 0, height, 0);// draw horizontal line rotate (ang); fill(255,0,0,50);// red square rect (0,0,40,40); rotate (-ang); translate (40,40); rotate (ang); fill(0,255,0,50);// green square rect (0,0,20,20); rotate (-ang); translate (25,25); rotate (ang); fill(0,0,255,50);// blue square rect (0,0,10,10); ang+= TWO_PI/360; }