/* ---------------------------------------------- Computing Kaizen Studio Advanced Studio VI Spring 2010 Columbia University GSAPP Tracking Bodies Code by Anna Karigianni http://www.arch.columbia.edu/ http://proxyarch.com/kaizen This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License -----------------------------------------------*/ import traer.physics.*; boolean blobred; float touchThresh = 60; Graph myGraph; ParticleSystem physics; float numFrames = 1200; float medianTraffic = 0; PVector [] siteHexagon; float maxDist = 10.0; float camLen = 120; float camSpd = 0.0; Boolean updating = true; //THE BODY OF THE CARS Car[] myCars; float spacing = 2.0; float spacingZ = 2.0; int dimX =14; int dimY =10; int dimZ =3; Node current1; Node a1; Node b1; //CAR DIMENSIONS float w = 1; float h = w; float l = w; PVector [] pts; void setup(){ size(600, 450, P3D); randomSeed(10); physics= new ParticleSystem(0,0); myGraph = new Graph(physics); colorMode(HSB, 255); //make 3D frame of nodes Node[] bottomNodes = new Node[0]; int count = 0; for (int i=0; i0 ){ Node thePrevious = myGraph.getNodeByName( i + "_" + j + "_" + (k-1)); myGraph.connectNodes(theNode, thePrevious, .2, spacingZ); } if(j>0){ Node thePrevious = myGraph.getNodeByName( i + "_" + (j-1) + "_" + (k)); if (thePrevious!= null){ myGraph.connectNodes(theNode, thePrevious, .2, spacing); } } if(i>0){ Node thePrevious = myGraph.getNodeByName( (i-1) + "_" + j + "_" + (k)); if (thePrevious!= null){ myGraph.connectNodes(theNode, thePrevious, .2, spacing); } } } } } } //make cars Node[] all = myGraph.getNodes(); myCars = new Car[30]; for(int i=0; i 0) blobred = true; } } // Resetting camera to top and drawing blobs - KEEP FOR NOW camera(); if (blobred) fill(255,200); else fill (255,200); noStroke(); pushMatrix(); translate(0,0,20); //ellipseMode(CENTER); ellipse(blobCenter.x, blobCenter.y, 50,50); popMatrix(); } void grid(){ // GRID stroke(160); for(int i=-200; i<=200; i+=25){ for(int j=-200; j<=200; j+=25){ line(-200, j, 200, j); line(i, -200, i, 200); } } stroke(120); for(int i=-200; i<=200; i+=50){ for(int j=-200; j<=200; j+=50){ line(-200, j, 200, j); line(i, -200, i, 200); } } stroke(80); strokeWeight(2); noFill(); rect(-200,-200,400,400); line(-200,0,200,0); line(0,-200,0,200); strokeWeight(1); }