/* ---------------------------------------------- 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 -----------------------------------------------*/ void depthCalc(){ all = myGraph.getNodes(); Node[] currentNodes = new Node[0]; getMaxValue = 0; for(int i=0; i 0){ rot_z = radians(360) - rot_z; } float rot_y = PVector.angleBetween(flat, a); if(a.z > 0){ rot_y = radians(360) - rot_y; } PVector b = new PVector(rot_y, rot_z); pushMatrix(); translate(start.x, start.y, start.z); rotateZ( -rot_z ); rotateY( rot_y ); translate( a.mag()/2.0 ,0,0); float newMag = max(0.0 , a.mag() - buffer*2); a.normalize(); a.mult(newMag); noStroke(); float offset = .75 * (2*PI); for(int i=startShape; i<4; i++){ beginShape(QUADS); vertex( a.mag()/2.0, sin(PI*-.25 + offset + i*HALF_PI)*thicknessB , cos(PI*-.25 + offset+ i*HALF_PI)*thicknessB) ; vertex( -a.mag()/2.0, sin(PI*-.25 + offset+ i*HALF_PI)*thicknessA , cos(PI*-.25 + offset+ i*HALF_PI)*thicknessA); vertex( -a.mag()/2.0, sin(PI*.25 + offset+ i*HALF_PI)*thicknessA , cos(PI*.25 + offset+ i*HALF_PI)*thicknessA); vertex( a.mag()/2.0, sin(PI*.25 + offset+ i*HALF_PI)*thicknessB , cos(PI*.25 + offset+ i*HALF_PI)*thicknessB); endShape(CLOSE); } popMatrix(); }