xxxxxxxxxx
22
var rot = 0;
function setup() {
createCanvas(400, 400, WEBGL);
}
function draw() {
background(0);
ambientLight(mouseX, 400-mouseY, mouseY);
translate(mouseX-200,mouseY-200,mouseY-100);
rotateX(rot);
rotateY(rot);
rotateY(mouseX/100);
rotateX(mouseY/100);
noStroke();
fill(255,0,255);
sphere(60);
fill(400-mouseX,mouseY,mouseY,150)
torus(80,10);
torus(110,15);
torus(150,15);
rot = rot + 0.03;
}