aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2016-12-14 02:04:26 -0500
committercnlohr <lohr85@gmail.com>2016-12-14 02:04:26 -0500
commitb9fd6f212af57503b3792415a455f56abeecd5fd (patch)
tree07becbe447aaee43f1a40a943fb64ec78759636b /tools
parent6c07051d27aa4f7301dc89a5abe6c5c9fe457997 (diff)
downloadlibsurvive-b9fd6f212af57503b3792415a455f56abeecd5fd.tar.gz
libsurvive-b9fd6f212af57503b3792415a455f56abeecd5fd.tar.bz2
getting very, very close.
Diffstat (limited to 'tools')
-rw-r--r--tools/planetest/camfind.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/planetest/camfind.c b/tools/planetest/camfind.c
index e4e6a0f..6a6650b 100644
--- a/tools/planetest/camfind.c
+++ b/tools/planetest/camfind.c
@@ -162,8 +162,8 @@ float RunTest( int print )
if( hmd_point_counts[k] == 0 ) continue;
int axis = k%2;
int pt = k/2;
- float angle = (hmd_point_angles[k] - 200000) / 200000 * 3.1415926535/2;
- if( axis == 0) angle = -angle; //Flip coordinate systems
+ float angle = (hmd_point_angles[k] - 200000) / 200000 * 3.1415926535/2; //XXX XXX WRONG??? OR SOMETHING??? WHY DIV2 MAKE GOOD?
+ if( axis == 1) angle = -angle; //Flip coordinate systems
float thiseuler[3] = { 0, 0, 0 };
thiseuler[axis] = angle;
@@ -180,8 +180,8 @@ float RunTest( int print )
//plane_normal is our normal / LighthousePos is our point.
float w0[] = { hmd_points[pt*3+0], hmd_points[pt*3+1], hmd_points[pt*3+2] };
//float w0[] = { 0, 0, 0 };
- float d = plane_normal[0] * LighthousePos[0] + plane_normal[1] * LighthousePos[1] + plane_normal[2] * LighthousePos[2];
- float D = plane_normal[0] * w0[0] + plane_normal[1] * w0[1] + plane_normal[2] * w0[2] + d;
+ float d = -(plane_normal[0] * LighthousePos[0] + plane_normal[1] * LighthousePos[1] + plane_normal[2] * LighthousePos[2]);
+ float D = plane_normal[0] * w0[0] + plane_normal[1] * w0[1] + plane_normal[2] * w0[2] + d;
//Point line distance assuming ||normal|| = 1.
if( print ) printf( " %f %f -\n", d, D );