xxxxxxxxxx
60
function setup() {
createCanvas(400, 400, WEBGL);
}
function draw() {
background(205, mouseX, 94);
ambientLight(60);
// add point light to showcase specular material
let locX = mouseX - width / 3;
let locY = mouseY - height / 2;
pointLight(255, 255, 255, locX, locY, 50);
specularMaterial(250);
shininess(50);
rotateY(millis() / 1000);
noStroke();
orbitControl(60, 30, 30);
scale(2);
rotateX(1);
rotateY(1);
translate(p5.Vector.fromAngle(millis() / 1000, 30))
fill('blue');
box(100, 10, 40, 10, 10);
rotateY(millis() / 3000);
noStroke();
orbitControl(-70, random(), 40);
scale(1);
rotateX(1);
rotateY(1);
translate(p5.Vector.fromAngle(millis() / 1500, 30))
fill('yellow');
cylinder(20, 50);
(pop)
rotateY(millis() / 100);
noStroke();
orbitControl(0,0,0);
scale(1);
rotateX(5*mouseX);
translate(p5.Vector.fromAngle(millis() / 1000, 30))
fill('white')
box(70, 100, 20, 400);
}