//how can I get the e key to actually erase?- ARRAYLIST of boxes //how can I sort x values without losing the attached y,z, and color values?- Make boxes objects //NEED to be able to change vantage point to go over (and maybe to the side). Have to be able to get up. // Bigger boxes and or not as many- tiresome. //What are those lines when draw way out in distance? //NO printy outside of boxy. Squirtmanager sm; Squirt test; int pressMode;//start off noting that mouse has never been pressed color curcolor; int eraseMode; int scl=2; float boxsize=10; float curlayer; float floory=199; void setup () { size(800, 600, P3D); framerate(100); background(255, 255, 255); noStroke(); pressMode=0; eraseMode=0; curcolor= color(50, 200, 50); curlayer= floory-boxsize;//draw first layer right above floor PFont font; font = loadFont("ArialMT-14.vlw"); textFont(font, 14); sm = new Squirtmanager(); } void draw () { //float curcol=(mouseX/scl)-width/2;// / scl; //float currow=mouseY/scl-height/4;//determined experimentally//+zoff; ambientLight(100, 100, 100); //WAS 0.5 FOR ALL 3 directionalLight(255, 255, 255, 200, 200, 0); //(RVALUE, GVALUE, BVALUE, XPOS, YPOS, ZPOS translate(width/2, height/2, 0);/* Setting 3D origin to center of screen in screen plane.*/ background(0); renderstage(); stringtext(); sm.run(); } void mousePressed() { pressMode = 1; } void mouseReleased() { pressMode = 0; } void keyPressed() { if(key == CODED) { if (keyCode == UP) { nextlayer(); } else if (keyCode == DOWN) { prevlayer(); } } if (key == 'r' || key == 'R') { curcolor=color(200, 50, 50); } else if (key == 'g' || key == 'G') {//changes renderbox color to green curcolor=color(50, 200, 50); } else if (key == 'b' || key == 'B') {//changes renderbox color to blue curcolor= color(50, 50, 200); } else if (key == 'x' || key == 'X') { eraseMode=1; //have to decide what to do here. Will set squirtmanager to sort and then export sorted arraylist to new manager } } void nextlayer() { curlayer -= boxsize; } void prevlayer() { curlayer += boxsize; } 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(800, 1, 800); popMatrix(); //1 } void stringtext() { String sf = "SNACKFAX"; fill(255, 100, 100); text(sf, 100, -205, 175, 200, 150); String m = "Click & drag to draw"; String s = "UP- next layer up"; String l = "DOWN- prev layer down"; String r = "R- red frosting"; String g = "G- green frosting"; String b = "B- blue frosting"; String x = "X- delete mode; erases"; fill(255, 255, 255); text(m, 100, -190, 175, 200, 150); text(s, 100, -175, 175, 200, 150); text(l, 100, -160, 175, 200, 150); text(r, 100, -145, 175, 200, 150); text(g, 100, -130, 175, 200, 150); text(b, 100, -115, 175, 200, 150); }