Hi Justin, I've just review the code and yes there is a potential issue when the projection direction of the overlay (the lookVector varaible in this code) is co-incident with the main camera's look vector (frustum_axis in this code).
Catching this case with a check of sideVector.length()< 1.0 is a bit over zealous, as numerical errror could easily lead to value slightly less than 1.0 but still have a perfectly valid vector. Something like sideVector.length()<1e-3 would probably be more appropriate as we only need to catch cases where the vector is close to 0.0. Robert. On 7/3/07, KSpam <[EMAIL PROTECTED]> wrote:
There is a singularity in OverlayNode.cpp in the traverse_VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY method. This singularity is evident when frustum_axis (line 1463) approaches lookVector (line 1465). To resolve this, I added the following code following sideVector.normalize() (line 1476): if (sideVector.length() < 1.0) { sideVector = osg::Vec3d(1.0, 0.0, 0.0); } Is this a reasonable fix? Thanks, Justin _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/