xxxxxxxxxx
60
var x = 0;
var x2 = 50;
var y = 0;
var y2 = 50;
var rot = 0;
var rot2 = 0;
var increase = 5;
var increase2 = 0.01;
var increase3 = 5;
var rotStop = 13.29;
var rotStop2 = 13.29;
var start = 0;
var surface;
//11.6 13.29 14.94 16.3
function setup() {
createCanvas(400, 400, WEBGL);
surface = loadImage("download.jpeg");
}
function draw() {
background(0);
texture(surface);
ambientLight(150,120,255);
rotateX(rot2);
rotateY(rot);
box(x);
rot = rot + increase2;
rot2 = rot2 + increase2;
x = x + increase;
y = y + increase;
start = start + increase;
if (y > 1500) {
increase = 0;
box(x2);
if (rot2 > rotStop && rot > rotStop2) {
increase2 = 0;
x2 = x2 + increase3;
y2 = y2 + increase3;
if (y2 > 1500) {
increase2 = 0.01;
increase3 = 5;
increase = 5;
y2 = 50;
x = 1000;
x2 = 50;
rot = 0;
rot2 = 0;
y = 100;
}
}
}
if (start > 1500) {
box(start);
}
}
function keyPressed(){
print(rot);
increase = 0;
}