xxxxxxxxxx
35
let w = 24,
h = 24;
function setup() {
createCanvas(400, 400, WEBGL);
}
function draw() {
background(100);
//ortho(0, 0, 0, 0, 0, 1000);
//rotateX(200);
translate(-200,-200,-160);
for (let x = 0; x < width; x += w*4) {
for (let y = 0; y < height; y += w*4) {
push();
translate(x,y);
normalMaterial();
rotateX(frameCount*0.02);
cylinder(w, h*2);
pop();
}
}
for (let x = w*2; x < width; x += w*4) {
for (let y = w*2; y < height; y += w*4) {
push();
translate(x,y);
normalMaterial();
rotateX(frameCount*-0.02);
cylinder(w, h*2);
pop();
}
}
}