xxxxxxxxxx
44
function setup() {
createCanvas(400, 400, WEBGL);
}
function draw() {
background(220);
fill(255, 255, 0);
arc(80, -150, 90, 80, 160, 40);
circle(80, -170, 20);
fill(255, 50, 50);
rect(20, 40, 60, 40);
strokeWeight(4);
ambientMaterial(5);
rotateX(accelerationX * 0.08);
rotateY(accelerationY * 0.08);
triangle(80, 90, 100, 40, -50, 100);
let locX = mouseX - height / 2;
let locY = mouseY - width / 2;
ambientLight(60, 60, 60);
pointLight(60, 70, 80, locX, locY, 100);
push();
translate(-width / 4, -height / 4, 0);
rotateZ(frameCount * 0.01);
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.01);
fill(90, 90, 90);
specularMaterial(100);
torus(50, 24, 16, 24);
pop();
normalMaterial();
rotateX(accelerationX * 0.08);
rotateY(accelerationY * 0.08);
box(80, 80, 200);
}