Hi Chris, On 11/23/06, c sklu <[EMAIL PROTECTED]> wrote:
You've probably refactored this quite a bit already but have found a bug, a few optimzations, and a question:
Haven't touched the code yet.. been busy with other work. When I get back to the intersection work I'll scoop up what you have done.
Bug: PolytopeFunctor.cpp intersectSegmentPlane(), the checks on the D and N values should use absolute values Optimizations: PolytopeFunctor::intersects(Vec3,Vec3) could add an extra parameter: bool checkPoints which tells it whether to call the intersects(Vec3) version, this is useful for: PolytopeFunctor::intersects(Vec3,Vec3,Vec3) first calls the single point intersects() then the double point intersects() with false as the checkPoints parameter: Question: Can you/anyone think of any (fast) way of handling the case when a triangle completely contains the polytope?
A tetrahedra could completely contain a polytope, but not a planer object like a triangle. I presume you mean that the triangle intersects the polytope, but all corners of the triangle are outwith the polytope. The way I'd tackle this would be to treat the triangle as a polygon with initially 3 points. Then cut this polygon by each plane of the polytope, the result being the part of the polygon that is inside the polytope. Each cut will make the polytope smaller, and may require insertion of points and as well as the possibility of culling old ones. Once you have cut the polygon by all sides of the polytope you'll have the final intersecting polygon, if you have already culled all the corners of the polygon away then it doesn't intersect. Robert. _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/