//********************************************************************// //CAAD D_ARCH UnCover PSZ Project: Pillars_Pavilion MAIN TASK // //WS06/07 12. FEB. 2007 by Huang, Yung-Chieh | BaTeam MaeTaB // //********************************************************************// void setup() { size(600,600, P3D); noCursor(); } float sval = 1.0; //3Dviewport, variable for zoom control float nmx, nmy; //3dviewport, variable for shift control int Dmax = 600; //maximum affection distance int Dadd = 45; //distance step value void draw() { int Bay = 25; //grid distance float Radius = Bay/10; //grid radius int Columns = width/Bay; //grid columns int Rows = height/Bay; //grid rows int MouseNumber = 2; //number of affection field PFont instruction = loadFont("HelveticaNeue-BoldItalic-12.vlw"); textFont(instruction, 12); /**********Create Cursor Circul**********/ Cursor[] myCursors = new Cursor[MouseNumber]; myCursors[0] = new Cursor(mouseX, mouseY); myCursors[1] = new Cursor(width-mouseX, height-mouseY); /**********Create Pillars Matrix**********/ Pillar[][] movingPillars = new Pillar[Columns][Rows]; for(int i=1; i 1.0) { nmx += (mouseX-nmx)/50; } if (abs(mouseY - nmy) > 1.0) { nmy += (mouseY-nmy)/50; } if(mousePressed) { sval += 0.05; } else { sval -= 0.1; } if(sval > 2.5) { sval = 2.5; } if(sval < 1.0) { sval = 1.0; } translate(width/2-nmx*sval, height/2-nmy*sval+100, 0); scale(sval/1.5); rotateX(PI/sval/5); rotateY(sval/5-0.2); translate(width/3, height/3, -50); } else { textAlign(LEFT); text("hold any key to switch to perspective mode", 5, height-5); textAlign(RIGHT); text("press mouse button to adjust territory: "+ Dmax/15 +"/100", width-5, height-5); /**********Top View Control Mouse Behavior**********/ if (mousePressed) { Dmax+= Dadd; if(Dmax > 1480){ Dadd= -Dadd; } else if(Dmax < 620){ Dadd= -Dadd; } } } /**********Draw Cursors**********/ myCursors[0].cruise(Dmax/15); myCursors[1].cruise(Dmax/15); /**********Draw Pillars**********/ for(int i=1; i