From e9e12efa3333f0f9e1b7baa84e8a8802733b13ac Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 21 Mar 2012 15:57:14 +0000 Subject: ofxRay confusion --- rayhit/src/testApp.cpp | 109 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 rayhit/src/testApp.cpp (limited to 'rayhit/src/testApp.cpp') diff --git a/rayhit/src/testApp.cpp b/rayhit/src/testApp.cpp new file mode 100644 index 0000000..750287c --- /dev/null +++ b/rayhit/src/testApp.cpp @@ -0,0 +1,109 @@ +#include "testApp.h" + +//-------------------------------------------------------------- +void testApp::setup(){ + ofVec3f centre=ofVec3f(ofGetWidth()/2,ofGetHeight(),0); + ofVec3f normal=ofVec3f(0,0,1); + ray=ofRay(); + plane=ofPlane(centre,normal); + + projector=ofProjector(ofGetWidth(),ofGetHeight()); + + pos=ofVec3f(ofGetWidth()/2,ofGetHeight()/2,0); +} + +//-------------------------------------------------------------- +void testApp::update(){ + + + +} + +//-------------------------------------------------------------- +void testApp::draw(){ + ofBackground(0,0,0); + plane.draw(); + + float gap=ofGetHeight()-ofGetWidth(); + + ofPushMatrix(); + + ofTranslate(0,ofGetHeight(),0); + ofRotate(cam_angle,1,0,0); + ofTranslate(0,-ofGetHeight(),0); + + for (float i=0;i