From 01529fbe5dd7cffbc78bd21118e601b0a47172d4 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 13 Jun 2012 17:53:08 +0100 Subject: centre seeking real good --- gaunt01/src/testApp.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gaunt01/src/testApp.cpp') 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 trapdoors; -- cgit v1.2.3