xxxxxxxxxx
30
let t = 0, amountOfFrames, increment;
function setup() {
createCanvas(610, 400);
fill(0);
noStroke();
frameRate(30);
amountOfFrames = 120;
increment = TWO_PI / amountOfFrames;
}
function draw() {
background(255);
let a = 0.0008 * map(sin(t), -1, 1, 0, 1);
a = 0.001;
let num = 0;
for (let x = 0; x <= 600; x += 600/16 * 0.25) {
for (let y = 0; y <= 400; y += 400/9 * 0.25) {
let m = (x - 0) * (y - 0) * a + t;
let xx = 20 + x + cos(m) * 10;
let yy = 10 + y + sin(m) * 10;
ellipse(xx * 0.95, yy * 0.9 + 10, 5);
num++;
}
}
t += increment;
if (t >= TWO_PI) {
t = 0;
}
}