/* ---------------------------------------------- Computing Kaizen Studio Advanced Studio VI Spring 2010 Columbia University GSAPP Informational Body Code by Esther Cheung http://www.arch.columbia.edu/ http://proxyarch.com/kaizen This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License -----------------------------------------------*/ class Point{ //properties PVector pos; float a; Boolean plotStatus; float opacity; boolean touched; int age; //constructor Point( PVector _pos, float _a){ opacity = 255; pos = _pos; a = _a; plotStatus = false; age = 0; } //method 1 void figureStatus(float threshold, float range){ plotStatus = false; //touched = false; if( abs(threshold-a) < range ){ plotStatus = true; opacity = 255-abs(threshold-a)/range * 255; } } //method 2 void plot(float threshold, float range){ if (this.touched == true) age ++; if (this.age > 30) { this.age = 0; this.touched = false; } if(plotStatus) plotBox(); } //method 3 void plotBox(){ noStroke(); pushMatrix(); translate(this.pos.x, this.pos.y, this.pos.z); if(!touched){ fill(0, 200, min(255,abs(a-threshold)*255*5+50)); stroke(0); point(0,0,0); } else{ fill(0, 200, min(255,abs(a-threshold)*255*5+50)); box(2); } popMatrix(); } }