import damkjer.ocd.*; import processing.opengl.*; import javax.media.opengl.*; import toxi.math.noise.*; import toxi.math.waves.*; import toxi.geom.*; import toxi.math.*; Cube c; float a = 0; Plane p; float numb = 26; PFont font; Camera orthoCam; boolean hit = false; boolean selected; PGraphicsOpenGL pgl; GL gl; POV pov; int xSize, ySize; //Cube[] cc = new Cube[26]; void setup(){ size(800, 800, OPENGL); hint(ENABLE_OPENGL_4X_SMOOTH); colorMode(HSB); //sphereDetail(1); //textMode(SHAPE); p = new Plane(0, 30, 100, 150, 150); font = createFont("SansSerif", 90); float tarX = p.px-150; float tarY = p.py; float tarZ = p.pz; pov = new POV( this ); pgl = (PGraphicsOpenGL) g; orthoCam = new Camera(this); } void draw(){ textFont(font); background(0); lights(); pov.exist(); rotateY(PI/2); rotateX(-PI/2); pointLight(51, 102, 126, 35, -340, 136); pointLight(255, 255, 0, -305, 240, -436); pointLight(0, 255, 0, 305, 0, 36); p.createPlane(); p.addCubesToPlane(); orthoCam.feed(); text("right click&drag to move the camera", 100,-80); } boolean checkDist(float x1,float y1,float z1, float thresh) { // check distance between mouse & object float theDist = dist(mouseX,mouseY,0,x1,y1,z1); if (theDist < thresh) { return true; } else { return false; } } void mousePressed(){ if( mouseButton == RIGHT ){ pov.ISDRAGGING = true; } } void mouseReleased(){ if( mouseButton == RIGHT ){ pov.ISDRAGGING = false; } } void mouseMoved(){ pov.ISMOVING = true; }