From a47b39541a7f60dfdda921c9598abe947e1e6ad9 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 28 Mar 2012 00:42:08 +0100 Subject: rayhit still iffy. starting morpher --- rayhit/src/testApp.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'rayhit/src/testApp.cpp') diff --git a/rayhit/src/testApp.cpp b/rayhit/src/testApp.cpp index 78a3890..392e84d 100644 --- a/rayhit/src/testApp.cpp +++ b/rayhit/src/testApp.cpp @@ -2,15 +2,26 @@ //-------------------------------------------------------------- void testApp::setup(){ - ofVec3f centre=ofVec3f(ofGetWidth()/2,0,0); + 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); - //Projector::Projector(float throwRatio, const ofVec2f& lensOffset, int width, int height) + //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); @@ -38,7 +49,7 @@ void testApp::update(){ void testApp::draw(){ ofBackground(0,0,0); - cam.begin(); + //cam.begin(); plane.draw(); @@ -61,7 +72,7 @@ void testApp::draw(){ ofPopMatrix(); - ofSphere(pos.x,pos.y,pos.z,2); + ofSphere(pos.x,pos.y,pos.z,20); /* for (int j=0;j