#include "testApp.h" //-------------------------------------------------------------- void testApp::setup(){ ofVec3f centre=ofVec3f(ofGetWidth()/2,0,0); //ofGetHeight(),0); ofVec3f normal=ofVec3f(0,0,-1); ray=ofRay(); plane=ofPlane(centre,normal); plane.color=ofColor(255,255,255); //setup that works for a new camera. but can we match the existing camera, must be possible! /* projector=ofProjector(1.535f, ofVec2f(0.0f, 0.5f),ofGetWidth(),ofGetHeight()); projector.setPosition(ofGetWidth()/2,ofGetHeight()/2,ofGetHeight()); */ //Projector::Projector(float throwRatio, const ofVec2f& lensOffset, int width, int height) projector=ofProjector(2.0f, ofVec2f(0.0f, 0.0f),ofGetWidth(),ofGetHeight()); //1.535f projector.setPosition(ofGetWidth()/2,ofGetHeight()/2,-ofGetWidth()); projector.lookAt(ofVec3f(ofGetWidth()/2,ofGetHeight()/2,0),ofVec3f(0, -1, 0)); pos=ofVec3f(ofGetWidth()/2,ofGetHeight()/2,0); cam=ofCamera(); //cam defaults to (0,0,0); cam.setPosition(ofGetWidth()/2,ofGetHeight()/2,ofGetHeight()); //cam.setOrientation(ofVec3f(0,0,1)); cam.lookAt(ofVec3f(ofGetWidth()/2,ofGetHeight()/2,0)); cam.setFov(54.13); //ofVec3f campoint=cam.getLookAtDir(); //printf("camera at %f,%f,%f looking %f,%f,%f\n",cam.getX(),cam.getY(),cam.getZ(),campoint.x,campoint.y,campoint.z); cam_angle=0; //projector=ofProjector(cam.getProjectionMatrix(ofRectangle(0,0,ofGetWidth(),ofGetHeight())),ofGetWidth(),ofGetHeight()); } //-------------------------------------------------------------- void testApp::update(){ } //-------------------------------------------------------------- void testApp::draw(){ ofBackground(0,0,0); //cam.begin(); plane.draw(); ofPushMatrix(); //ofTranslate(0,ofGetHeight(),0); ofRotate(cam_angle,1,0,0); //ofTranslate(0,-ofGetHeight(),0); for (float i=0;i