void setup() { size( 500, 500 ); } void draw() { background( 255 ); fill( 100 ); rotate( map( mouseX, 0, width, 0, radians(90) ) ); rect( 300, -50, 200, 100 ); }