xxxxxxxxxx
26
let angle = 0
function setup(){
createCanvas(400, 400);
}
function draw(){
background(0,0,0);
push();
translate(width/2,height/2);
fill(0,100,0);
ellipse(0,0,50,50);
rotate(angle);
push();
// move the origin to the pivot point
translate(150, 20);
// then rotate the grid around the pivot point by a
// number of degrees equal to the frame count of the sketch
rotate(angle);
fill(256,0,0);
rect(0, 0, 100, 100);
// and draw the square at the origin
}