xxxxxxxxxx
22
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
frameRate(60);
}
function draw() {
background(0);
ambientLight(127);
pointLight(127, 255, 255, -200, -400, 400);
specularMaterial(255);
noStroke();
rotateX(frameCount / 240.0);
rotateY(frameCount / 240.0);
for (let i = 0; i < 120; i++) {
push();
specularMaterial(i * 4, 127, 255 - i * 4);
rotateX(frameCount / 200.0 + i / 20.0);
rotateY(frameCount / 300.0 + i / 20.0);
box(width / 4.0);
pop();
}
}