How can i make each rectangle rotate along the y-axis on their own x positions?

function setup(){ createCanvas(1000, 400); rectMode(CENTER); } function draw(){ background(240);

translate(150, 150); 

rotate(radians(mouseY));

fill(0);
rect(0, 0, 100, 100);
rotate(radians(mouseY));
fill(0);
rect(200, 0, 100, 100);
rotate(radians(mouseY));
fill(0);
rect(400, 0, 100, 100);

}

Sign In or Register to comment.