diff options
author | CNLohr <charles@cnlohr.com> | 2016-12-17 23:38:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-17 23:38:07 -0500 |
commit | 481ace00a16137c046d8d819ed8db2661ad4ebf0 (patch) | |
tree | 4253435f6fe5a7547303e61875265b1a0749f438 /tools/planetest2/camfind.c | |
parent | ecfff2e6c861e145083fef897f3f415d962d08ec (diff) | |
parent | b7fb3da1e3d345d88fffca313fefb8ee8c2e23b0 (diff) | |
download | libsurvive-481ace00a16137c046d8d819ed8db2661ad4ebf0.tar.gz libsurvive-481ace00a16137c046d8d819ed8db2661ad4ebf0.tar.bz2 |
Merge pull request #6 from revirescam/master
better axes, for voxetastic. (untested).
Diffstat (limited to 'tools/planetest2/camfind.c')
-rw-r--r-- | tools/planetest2/camfind.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/planetest2/camfind.c b/tools/planetest2/camfind.c index 19c522c..796ebbf 100644 --- a/tools/planetest2/camfind.c +++ b/tools/planetest2/camfind.c @@ -82,13 +82,16 @@ int main() float sk = ft*10.; if( sk > 1 ) sk = 1; uint8_t cell = (1.0 - sk) * 255; - if( dz == 0 && ( dx > -0.01 && dx < 0.4 ) && (dy > -0.01 && dy < 0.4 ) ) - { - fprintf( f, "%c", 255 ); + FLT epsilon = 0.1; + + if( dz == 0 ) { /* Why is dz special? ? */ + if ( dx > -epsilon && dx < epsilon ) + cell = 255; + if ( dy > -epsilon && dy < epsilon ) + cell = 128; } - else - fprintf( f, "%c", cell ); + fprintf( f, "%c", cell ); } if( ft < beste ) { beste = ft; memcpy( bestxyzrunning, LighthousePos, sizeof( LighthousePos ) ); } |