xxxxxxxxxx
26
const amount = 24;
const radius = 100;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES); // Change the mode to DEGREES
}
function draw() {
background(220);
// start at center
translate(width / 2, height / 2);
// let's go for a spin
// rotate(frameCount/10);
for(let i=0; i<amount; i++) {
push();
const degree = (i/amount-1) * 360;
rotate(degree);
translate(radius, 0);
rect(-10, -10, 40, 20);
pop();
}
}