xxxxxxxxxx
28
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
frameRate(3);
}
function draw() {
background(50);
lights();
orbitControl();
rotateY(PI / 4)
rotateX(millis() / 20000);
//rotateZ(PI / 4);
for (x = -width / 2; x < width / 2; x += 50) {
for (y = -height / 2; y < height / 2; y += 50) {
y += 1;
let z = x + y/2;
z = cos(dist(x, y, 10, 20)/50 + frameCount/25)*30
let r = map(mouseX, 0, width, random(50), random(40));
push();
translate(x, y, z);
fill(x+width/2, y+height/2, 60);
noStroke();
box(r);
pop();
}
}
}