xxxxxxxxxx
43
var changey=1
var y=50
var rot=0
var R=255
var G=255
var B=255
function setup() {
createCanvas(500, 500,WEBGL);
}
function draw() {
background(0,0,0);
pointLight(R,G,B,100,-400,400);
pointLight(R,G,B,100,-400,400);
pointLight(R,G,B,100,-400,400);
pointLight(R,G,B,100,-400,400);
translate(0,0)
camera(mouseX-200,mouseY-200,400,0,0,0,0,1,0)
rotateY(-0.5)
rotateX(rot)
stroke(R,G,B)
strokeWeight(3)
noFill()
box(50,y,50);
box(y,50,50);
box(50,50,y);
box(5,y,y)
box(y,5,y)
box(y,y,5)
rot=rot+0.07
y=y+changey
if (y>49){
changey=5
frameRate(50)
}
if (y>400){
y=-y
R=random(1,255)
G=random(1,255)
B=random(1,255)
}
}