xxxxxxxxxx
72
var zplane = -500;
var zob = -300;
var Tobx;
function setup() {
createCanvas(500, 500, WEBGL);
avoidClipping();
}
function draw() {
background(220);
// translate(-width,-height);
if (frameCount % 100 == 0)
Tobx = random(-50, 60);
{
push();
translate(Tobx, 0, zob);
fill(255);
stroke(0);
box(60, 60, 60);
pop();
}
push();
translate(0, 60, zplane);
fill(0);
box(500, 20, 120000);
pop();
fill(250, 1, 5);
translate(0, 50, 200 + 10 * 5);
box(55, 65, 55);
stroke(255);
zob += 2;
zplane += 2; //5;
}
function avoidClipping() {
// avoid clipping (at camera):
// https : //
// forum.processing.org/two/discussion/4128/quick-q-how-close-is-too-close-why-when-do-3d-objects-disappear
perspective(PI / 3.0, width / height, 1, 1000000);
} //func