xxxxxxxxxx
32
let num = 8;
function setup() {
createCanvas(800, 800, WEBGL);
}
function draw() {
orbitControl();
//ortho();
let spacing = width / num;
let x = -(width / 2);
let y = -(height / 2);
let z = -400;
background(220);
for (let i = 0; i < num; i++) {
for (let j = 0; j < num; j++) {
for (let k = 0; k < num; k++) {
push();
translate(x, y, z);
emissiveMaterial("blue");
box(spacing - 10);
pop();
z += spacing;
}
z = -400;
x += spacing;
}
x = -(width / 2);
y += spacing;
}
}