void renderstage() { //regardless of whether or not mouse pressed, draw the box in at every frame pushMatrix(); //1 fill(255,255,255);//was just (0.03) translate(0, 200, 0); box(600, 1, 600); popMatrix(); //1 } void renderboxes(int _i) { int i= _i; //draw boxes and rotate them pushMatrix(); //1 //rotateY(-float(trail[i][2])/1000); //if you comment this one out the boxes all draw in one plane, but the lines keep drawing through many planes translate(trail[i][0], trail[i][1], trail[i][2]); //translate(trail[i][0], 199, 0);// this makes the cheese fall //translate(trail[i][0], 170, 0); //this does not work to put a second layer if (trail[i][3]==0) {//don't do anything } else if (trail[i][3]==1) {//red fill(200, 50, 50); box(8); } else if (trail[i][3]==2) {//green fill(50, 200, 50); box(8); } else if (trail[i][3]==3) {//blue fill(50, 50, 200); box(8); } else if (trail[i][3]==0) {//white to erase-doesn't overwrite the previous colors fill(255, 255, 200); box(8); } popMatrix(); //1 } void rendershadows(int _i) { int i= _i; //make box shadows on the floor of the box as thick as boxes are and turn them pushMatrix(); //rotateY(-float(trail[i][2])/1000);//set z //translate(trail[i][0], 199, 0); translate(trail[i][0], 199, trail[i][2]); fill(0); box(8, 1, 8);//this draws the shadows popMatrix(); } void renderlines(int _i) { int i= _i; //println(rotation); //println(-float(trail[i-1][2])/1000); //draw the lines connecting the boxes and rotate them pushMatrix(); stroke(100, 100, 100); //define line color strokeWeight(2); //rotateY(-float(trail[i-1][2])/1000);//set z translate(trail[i-1][0], trail[i-1][1], trail[i-1][2]); beginShape(LINES); vertex(trail[i-1][0], trail[i-1][1], trail[i-1][2]); vertex(trail[i][0], trail[i][1], trail[i][2]); endShape(); popMatrix(); } void renderlineshadows(int _i) { int i= _i; //draw the line shadows and rotate pushMatrix(); //rotateY(-float(trail[i-1][2])/1000); //set z stroke(0); beginShape(LINES); // britta- play with this function. You can't do vertex, translate, and another vertex. Have to do an end shpae between the vetices if using translate. vertex(trail[i-1][0], 199, 0); vertex(trail[i][0], 199, 0); endShape(); popMatrix(); noStroke(); }