/* ---------------------------------------------- Computing Kaizen Studio Advanced Studio VI Spring 2010 Columbia University GSAPP Inverting Bodies Code by Paige Mader 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.*; Graph myGraph; ParticleSystem physics; Particle[] siteParticles; int newLeafCount = 0; PVector[] sitePts; PVector siteCentre; int getMaxValue; float[][] pts; Node[] all; float sprLength = 2; float sprStrength = .05; float attStrength = -.11; float attMinDist = .04; String[] records; void setup(){ size(600,450,P3D); int newLeafCount = 0; colorMode(HSB, 255); records = loadStrings("program_data.csv"); reset(); } void mousePressed(){ reset(); } void reset(){ physics = new ParticleSystem(0.0, 0.2); myGraph = new Graph( physics ); for(int i=0; i 0){ String[] links = split( items[2], "|"); for(int j=0; j 3){ all = myGraph.getNodes(); for(int j=0; j 1){ Node newLeaf = myGraph.addLeaf("New Leaf # " + newLeafCount, testNode, 1, sprStrength, sprLength); newLeaf.p.position().set( testNode.p.position().x()+random(-2,2), testNode.p.position().y()+random(-2,2), 0); myGraph.connectNodes( testNode, newLeaf, sprStrength, sprLength); newLeafCount ++; depthCalc(); break; } } } physics.tick(.25); myGraph.update(); myGraph.plot3D(.1); // Resetting camera to top and drawing blobs - KEEP FOR NOW camera(); fill(255,0,255,200); noStroke(); ellipse(blobCenter.x, blobCenter.y, 50,50); all = myGraph.getNodes(); int allDepths = 0; for(int i=0; i