[Plib-cvs] plib/examples/src/ssg/viewer viewer.cxx,1.26,1.27
Brought to you by:
sjbaker
From: Bram S. <br...@us...> - 2005-08-21 08:04:15
|
Update of /cvsroot/plib/plib/examples/src/ssg/viewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4055 Modified Files: viewer.cxx Log Message: avoid placing nearplane beyond object Index: viewer.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/ssg/viewer/viewer.cxx,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- viewer.cxx 26 Feb 2005 15:22:33 -0000 1.26 +++ viewer.cxx 21 Aug 2005 08:04:06 -0000 1.27 @@ -145,7 +145,7 @@ static GLfloat Ez = 0.0f; #define FOVY 45.0f -#define NEAR 2.0f +#define NEAR 0.1f #define FAR 10000.0f static int getWindowHeight () { return glutGet ( (GLenum) GLUT_WINDOW_HEIGHT ) ; } @@ -672,6 +672,8 @@ SGfloat radius = scene->getBSphere()->getRadius(); EyeDist = float( radius * 1.5f / tan( float( FOVY/2 * SG_DEGREES_TO_RADIANS ) ) ); + if (EyeDist < NEAR*2) + EyeDist = NEAR*2; sgSphere sp = *( scene -> getBSphere() ) ; if ( sp.isEmpty() ) |