xxxxxxxxxx
49
const points = [];
const points2 = [];
function setup() {
createCanvas(500, 500);
noLoop();
for (let y = 0; y < 20; y++) {
for (let x = 0; x < 20; x++) {
points.push({
x: x * 50 - 150,
y: y * 50 - 250,
w: y * x,
h: x/y,
});
}
}
for (let y = 0; y < 20; y++) {
for (let x = 0; x < 20; x++) {
points2.push({
x2: x * 50 - 150,
y2: y * 50 - 250,
w2: y/x,
h2: x * y,
});
}
}
}
function draw() {
background(50);
fill(200);
noStroke();
rotate(PI*2.1);
for (let i = 0; i < points.length; i++) {
const p = points[i];
ellipse(p.x, p.y, p.w, p.h);
}
for (let i = 0; i < points2.length; i++) {
const p2 = points2[i];
ellipse(p2.x2, p2.y2, p2.w2, p2.h2);
}
}