float angle=0; void setup() { size(400,400); background(200,0,0); noStroke(); fill(255,0,0); } void loop() { background (200,0,0); translate (width/2, height/2); rotate(angle); circles(0, mouseY/2); angle+=0.1; if (angle>2*PI) angle=0; } void circles(int x, int y) { int i; //translate (centerX, centerY); float angle_intern=0; for (i=0; i<8; i++) { rotate(angle_intern); rect(x,y,10,10); angle_intern+=(2*PI/8); } }