Dear Peter, Robert, and all.
I would like to endorse Peter's remarks on the current implementation of
the LineSegmentIntersector. We experience precisely the same problems when
trying to pick on plane faces that coincide with the bounding box of the
Drawable to which they belong. The simplest example is a drawable consisting
of one triangle or quad aligning with the axes of the local coordinate frame.
Like Peter, we are also dealing with co-ordinate values running into the
thousands. The applied epsilon of 1e-4 in the intersectAndClip() function
is too small in suchlike cases, especially if the TriangleIntersector keeps
using floats at some places.
For the moment, we circumvent the problem by overloading the computeBound()
function of the Drawable and return a slightly bigger bounding box ourselves,
but a more general solution would be better in the end.
Like Peter, I also do not see why the intersectAndClip() function should
cut off those parts of the line segment that are outside the bounding box.
What is the computational benefit of this later on? I would expect it is
sufficient to check whether the line segment is crossing the box or not,
and neglect Drawables for which the answer is false.
However, assuming that this clipping does serve a goal, then my choice
would be not to assign the epsilon in the intersectAndClip() function
an absolute value, but to make it relative to the bounding box size,
for example by multiplying the current epsilon of 1e-4 with the diagonal
length of the bounding box.
Best regards,
Jaap Glas
dGB Earth Sciences
Enschede, The Netherlands
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54027#54027
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org