xxxxxxxxxx
34
let angle = 0;
let maskRect = 115;
function setup() {
createCanvas(500, 500);
}
function draw() {
background(0);
rectMode(CENTER);
noStroke();
fill(255, 0, 0);
push();
translate(width/2,height/2);
rotate(radians(45));
rect(0,0, 200, 200);
pop();
fill(0);
push();
translate(width / 3, height / 2);
rotate(radians(angle));
rect(0, 0, maskRect, maskRect);
pop();
push();
translate(width - width / 3, height / 2);
rotate(radians(angle));
rect(0, 0, maskRect, maskRect);
pop();
angle++;
}