Hello Robert.

I digged a bit into the OSG source code and I found out that its a precision 
problem. I use big models where the vertex coordinate values are >1000.
I don't know the exact process of the intersection search, but I assume that 
the lineSegment is clipped in the  

lineSegmentIntersector.cpp

Code:
bool LineSegmentIntersector::intersectAndClip(osg::Vec3d& s, osg::Vec3d& 
e,const osg::BoundingBox& bbInput)

 
function to the values, where the lineSegment is slightly longer, than the 
bounding sphere of the geometry. 

Code:
 osg::Vec3d bb_min(bbInput._min);
osg::Vec3d bb_max(bbInput._max);

#if 1
    double epsilon = 1e-4;
    bb_min.x() -= epsilon;
    bb_min.y() -= epsilon;
    bb_min.z() -= epsilon;
    bb_max.x() += epsilon;
    bb_max.y() += epsilon;
    bb_max.z() += epsilon;
#endif



There is an epsilon value, which is currently set to 1e-4. I would suggest to 
set it bigger (1e-2 f. ex.). If I change it to 1e-2, I don't get this problem 
anymore.

What is the exact reason of lineSegment clipping?

Thank you!

Cheers,
Peter
Code:




------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=51119#51119





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to