//import processing.opengl.*; Gbox[] gbox; int elem; float i = 0; float j = 1; int inout = 1; // PImage a; int count; float move; void setup() { size(screen.width,screen.height,P3D); noCursor(); //size(1000,850,P3D); //size(screen.width,screen.height,OPENGL); //size(1000,850,OPENGL); //a = loadImage("cardboard4.jpg"); //a = loadImage("numbers.png"); count = 0; move = 0; frameRate(30); elem = round(random(10)) + 10; //elem = round(random(3)+1); gbox = new Gbox[elem]; for(int l = 0; l < elem; l++) { gbox[l] = new Gbox(); } } void draw() { background(100,150,200); fill(100,150,255); noStroke(); rectMode(CENTER); rotateX(radians(-25)); lights(); /* texture test rect(width/2,0,width,150); beginShape(); textureMode(NORMALIZED); texture(a); vertex(0,0,0,0,0); vertex(100,0,0,1,0); vertex(100,200,0,1,1); vertex(0,200,0,0,1); endShape(CLOSE); image(a,width/2,0); */ pushMatrix(); if (gbox[elem-1].done == 1) { count++; if (count >= 30) { move += gbox[0].pr1.tween[count-30] * 30; translate(move,0,0); //translate(0,0-move,0); } if (count > 48) { count = 0; move = 0; setup(); } } translate(width/2,height/2,j); //translate(0,height/2,j); rotateY(radians(i)); gbox[0].displayboth(); gbox[0].growboth(); for(int k = 1; k < elem; k++) { if (gbox[k-1].done == 1) { gbox[k].displayboth(); gbox[k].growboth(); } } yard(); popMatrix(); i++; j += 8 * inout; if (j < -16 || j > 16) { inout *= -1; } } void houses05() { } void yard() { fill(random(100),random(100)+155,random(100)); rectMode(CENTER); pushMatrix(); translate(0,height/3,0); rotateX(radians(90)); rect(0,0,random(600)+600,random(600)+600); popMatrix(); } void mouseClicked() { setup(); }