function setup() {
let canvas = createCanvas(600, 600, WEBGL);
canvas.parent('animation-holder');
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
}
let cubes = [];
let circles = [];
function draw() {
background(255, 204, 0, 255);
strokeWeight(5);
let gridResolution = 6 + sin(frameCount * 0.01 + noise(frameCount * 0.005) * 10) * 3;
rotateY(sin(frameCount * 0.005) * 0.5);
for (let i = 0; i < gridResolution * gridResolution; i++) {
let x = (i % gridResolution) * 50 - 150;
let y = Math.floor(i / gridResolution) * 50 - 150;
let z = noise(frameCount * 0.005 + i * 0.05) * 200 - 100;
let displacement = noise(frameCount * 0.005 + i * 0.1) * 100 - 50;
push();
translate(x + displacement, y + displacement, z + displacement);
rotateY(frameCount * 0.015 * map(mouseX, 0, width, 0.5, 2) + i * 0.05 + noise(frameCount * 0.005 + i * 0.05, mouseY * 0.01) * 10);
rotateX(frameCount * 0.01 * map(mouseX, 0, width, 0.5, 2) + i * 0.05 + noise(frameCount * 0.005 + i * 0.1, mouseY * 0.01) * 10);
let colorValue = sin(frameCount * 0.025 + i * 0.05 + noise(frameCount * 0.005) * 5) * 127 + 128;
fill(255, colorValue * 0.8, 0, 255);
let boxSize = 35 + noise(frameCount * 0.005 + i * 0.1) * 15 + sin(frameCount * 0.025 + i * 0.05 + noise(frameCount * 0.005) * 3) * 15;
box(-boxSize / 2, -boxSize / 2, boxSize * 2);
push();
fill(255, 0, 0, 255);
ellipse(0, 0, 10 + noise(frameCount * 0.005 + i * 0.05) * 20 + sin(frameCount * 0.01 + i * 0.1 + noise(frameCount * 0.005) * 2) * 10);
pop();
pop();
}
for (let i = 0; i < 40; i++) {
let circleX = noise(frameCount * 0.005 + i * 0.1) * 400 - 200;
let circleY = noise(frameCount * 0.005 + i * 0.15) * 400 - 200;
let circleZ = noise(frameCount * 0.005 + i * 0.2) * 400 - 200;
push();
translate(circleX, circleY, circleZ);
stroke(0, 255);
fill(255, 255);
ellipse(0, 0, 25 + noise(frameCount * 0.005 + i * 0.05) * 50 + sin(frameCount * 0.01 + i * 0.15 + noise(frameCount * 0.005) * 2) * 25);
pop();
}
}