xxxxxxxxxx
26
const boxSize = 70;
let width, height;
function setup() {
width = window.innerWidth;
height = window.innerHeight;
createCanvas(width, height, WEBGL);
ortho();
}
function draw() {
clear();
translate(-width / 2 + (boxSize/2), -height / 2 + (boxSize/2), 0);
background(255);
for(let x = 0; x < width; x+=boxSize) {
for(let y = 0; y < height; y+=boxSize) {
push();
translate(x, y);
rotateX(10);
rotateY(mouseX * 0.01);
box(boxSize);
pop();
}
}
}