float ang; void setup() { size (200,200); background (255); framerate (50); rectMode(CORNER); } 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); translate (40,40);// green square rotate (ang); fill(0,255,0,50); rect (0,0,20,20); translate (20,20);// blue square rotate (ang); fill(0,0,255,50); rect (0,0,10,10); ang+= radians(1); }