Greetings osg community,

I'm have written a custom MatrixManipulator for a 2D scene and I am
experiencing a strange problem. As I pan and zoom around, some of the
nodes in the scene disappear abruptly as if they are being culled
inappropriately. However, disabling culling has no effect.

The behavior is erratic and unpredictable which smells to me like I'm on
the border of a floating point inequality. I have discovered two ways
that seem to make the problem go away.

One:

  One of the transformations I use to construct the view matrix is
  
    osg::Matrixd::rotate( osg::Quat( PI, osg::Vec3d( 1.0, 0.0, 0.0 ) ) )
  
  If I replace that with 
  
    osg::Matrixd::scale( osg::Vec3d( 1.0, -1.0, 1.0 ) )
  
  the problem seems to go away.

Two:

  All of the nodes in my seen that exhibit this problem have a 2D
  bounding box. i.e.

     osg::BoundingBox const & bb = pGeode->getBoundingBox();
     assert( bb.zMax() - bb.zMin() < 1e-5 );

  If I give the nodes some depth so that the above assert would fail,
  the problem seems to go away.

I suspect that these are not actual solutions. In any case, I would like
to understand what is happening under the covers. Any ideas?

Frank

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to