int i = 1; void setup(){ size(400,400); } void draw(){ // move coordinate 0,0 to the center of the screen translate(width/2, height/2); // rotate the cavas around 0,0 while drawing a rectangle rotate(radians(i = i + 2)); rect(0,0, 300, 30); }