summaryrefslogtreecommitdiff
path: root/gaunt01/src/testApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gaunt01/src/testApp.cpp')
-rw-r--r--gaunt01/src/testApp.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/gaunt01/src/testApp.cpp b/gaunt01/src/testApp.cpp
index 6ac3d26..379fb17 100644
--- a/gaunt01/src/testApp.cpp
+++ b/gaunt01/src/testApp.cpp
@@ -137,7 +137,6 @@ void testApp::setup(){
cam.end();
updatePlane();
- Bird.setBounds(bounds);
}
@@ -291,6 +290,15 @@ void testApp::updatePlane(){
else printf("bound plane 4 not found\n");
pn=(p-projector.getGlobalPosition()).getPerpendicular(ofVec3f(-1,0,0));
bounds[3]=ofPlane(p,pn); //,-pn,ofVec2f(1000,1000));
+
+ l=ofVec2f(windowWidth/2,windowHeight/2);
+ r=projector.castPixel(l.x,l.y);
+ if (plane.intersect(r,centre)) printf("found centre point at %f,%f,%f\n",centre.x,centre.y,centre.z);
+ else printf("centre point not found\n");
+ ofVec3f c=centre.rotated(cam_angle,ofVec3f(-1,0,0));
+
+ Bird.setBounds(bounds);
+ Bird.setCentre(ofVec2f(c.x,c.y));
// vector<trapdoor> trapdoors;