This one took a loooong time to tune up. The code is quite simple though:
canvasWidth = 600;
canvasHeight = 400;
path = canvasWidth/14;
n=30
c =0;
size = 8;
function setup() {
createCanvas(canvasWidth, canvasHeight);
}
function draw() {
background(0)
c+=0.05;
cosOffset = sin(c/300) * 5;
for(let i = n; i>=0; i--){
fill(255-i*255/n);
circle(canvasWidth/2 + cos(c+i*cosOffset)*path, canvasHeight/2, size + i*size);
}
}
Deja una respuesta