/* ---------------------------------------------- Computing Kaizen Studio Advanced Studio VI Spring 2010 Columbia University GSAPP Distressed Bodies Code by Biayna Bogosian http://www.arch.columbia.edu/ http://proxyarch.com/kaizen This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License -----------------------------------------------*/ void reset(){ fill(230); myNodes.clear(); myConnections.clear(); int rows = floor(width/spacing)+1; int cols = floor(width/spacing)+1; int counter = 0; for(int i=0; i 50){ physics.makeAttraction( theOther.theParticle, myNode.theParticle, -50, spacing/2.0); } } if((j>0) && (j%rows != 0)){ Node previousNode = (Node) myNodes.get(counter-1); Connections myConnection = new Connections(myNode, previousNode); myConnections.add( myConnection ); } if((i>0) && (i%cols != 0)){ Node otherNode = (Node) myNodes.get(counter-rows); Connections myConnection = new Connections(myNode, otherNode); myConnections.add( myConnection ); } if((i==0) && (j==0)){ myNode.theParticle.makeFixed(); } if((i==0) && (j==rows-1)){ myNode.theParticle.makeFixed(); } if((i==cols-1) && (j==0)){ myNode.theParticle.makeFixed(); } if((i==cols-1) && (j==rows-1)){ myNode.theParticle.makeFixed(); } counter++; } } for(int i=0; i<40; i++){ physics.tick(0.3); } background(230); }