xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
colorMode(HSB, 360, 100, 100, 100);
angleMode(DEGREES);
blendMode(MULTIPLY);
}
function draw() {
camera(100, 0, 25 + sin(frameCount * 0.65) * 500, 0, 0, 0, 0, 1, 0);
// // //20 + sin(frameCount * 1) * -10
push();
translate(-windowWidth / 2, -windowHeight / 2, 0);
background(177, 0, 90);
ambientLight(200);
let cells = 5;
// let offset = width /
let w = width / cells;
let h = height / cells;
num = random(int(2));
for (let j = 0; j < cells; j++) {
for (let i = 0; i < cells; i++) {
let x = i * w;
let y = j * h;
let d = w / 3;
push();
translate(x + w / 2, y + h / 2);
rotateX(frameCount * 0.2);
rotateY(frameCount * 0.2);
rotateZ(frameCount * 0.2);
stroke("#fff");
specularMaterial(223, 82, 90, 20);
box(d - d / 3, d - d / 3);
pop();
push();
translate(x + w / 2, y + h / 2);
rotateX(frameCount * 0.1);
rotateY(frameCount * 0.5);
stroke("#fff");
specularMaterial(177, 55, 98, 30);
box(d, d);
pop();
push();
translate(x + w / 2, y + h / 2);
rotateZ(frameCount * -0.5);
rotateY(frameCount * -0.5);
stroke("#6efaf5");
specularMaterial(306, 16, 100, 20);
box(d + d / 3, d + d / 3);
pop();
}
}
pop();
}