//Why don't the line shadows appear until after you press the down key? //Second problem: see keypressed. How do I notate if "r' pressed? int pressMode = 0;//start off noting that mouse has never been pressed int maxTrailLength = 5000; int[][] trail = new int[maxTrailLength][4];/* We are declaring and creating our 2D array, an array of arrays, that contains all of the objects we need to draw our figure from mouse clicks. Come back and defin*/ int trailCounter = 0; //float rotation; int finalrot=0; int layery=199; int zoff=150; int frostingcolororoff= 1; int layerheight=195; void setup () { size(800,600, P3D); framerate(100); //colorMode(RGB, 1.0); background(255, 255, 255); noStroke(); } void draw () { //set up permanent lighting conditions that don't move ambientLight(100, 100, 100); //WAS 0.5 FOR ALL 3 directionalLight(255, 255, 255, 200, 200, 0); //(RVALUE, GVALUE, BVALUE, XPOS, YPOS, ZPOS //rotate the stage at the center of the screen window according to the set rotation angle, incrementing from 0 translate(width/2, height/2, 0);/* Setting 3D origin to center of screen in screen plane.*/ //rotateY(rotation); //this rotates the stage at a constant rate, note that it is set to 0 for the first cycle, then increments a tiny amt if( pressMode == 1 ) { /*this is for the first instance of the mouse being pressed and sets the conditions based on this starting point, but if they let up on the mouse, draw background so it doesn't keep creating boxes?*/ trail[trailCounter][0] = mouseX-width/2;// this saves the mouse x position but adjusted for the width/ height translate trail[trailCounter][1] = layerheight;//mouseY-height/2;// ditto for y trail[trailCounter][2] = zoff;//- height/2;//int(rotation*1000);//this is storing the angle of rotation that the mouse has passed through since the beginning of the program trail[trailCounter][3] = frostingcolororoff; //saves current value 0 (no print), 1, 2, or 3 //used the 1000 multiplier to avoid having to use a float because defined this as an integer array. } background(0); renderstage(); for( int i = 1; i < trailCounter; i++ ) {//start adding these boxes into our array and draw a line between each of them //Notice that this starts at 1 not at 0, that's why we are not getting an initial box.` if( trail[i][0] != 0 ) {//this keeps from drawing back to origin for last box if( trail[i-1][0] != 0 ) {// if you comment this out, the first line at mousepressed draws a line to the center renderboxes(i); rendershadows(i); renderlines(i); renderlineshadows(i); } } } trailCounter++; // add another column to the array of coordinate arrays so we're ready for the next point //if (finalrot == 1) {// this is if you are finished drawing and just want the whole thing to rotate so you can look at it- under key control //rotation += 0.025; //} } void filltosee() { for( int i = 1; i < trailCounter; i++ ) {//start adding these boxes into our array and draw a line between each of them // if( trail[i][0] != 0 ) {//if you comment this out, the last box before mousereleased draws a line back to the center // if( trail[i-1][0] != 0 ) {// if you comment this out, the first line at mousepressed draws a line to the center //add another layer of boxes just to demonstrate idea pushMatrix(); //1 rotateY(-float(trail[i][2])/1000); //set z translate(trail[i][0], trail[i][1], 0); //translate(trail[i][0], 170, 0);// this makes the cheese fall //translate(trail[i][0], 170, 0); //this does not work to put a second layer fill(100, 100, 0);//this fills in the EZ cheese- color changed to yellow box(8); popMatrix(); //1 } finalrot=1; // } //} }