xxxxxxxxxx
25
function setup() {
createCanvas(400, 400);
}
function draw() {
background(50);
noStroke();
fill(255);
let gridSize = 50;
for (let y = 0; y <= height; y += gridSize) {
for (let x = 0; x <= width; x += gridSize) {
drawSpinningEllipse(x, y, gridSize, 0.01);
}
}
}
function drawSpinningEllipse(x, y, len, spd) {
push();
translate(x, y);
rotate(frameCount * spd); // speed of rotation
ellipse(0, 0, len, len * 0.2); // w:length, h:20% of length
pop();
}