Point in degenerate triangle?
I'm testing this point in triangle test, and it doesn't seem to work for degenerate or very thin triangles:
http://jgt.akpeters.com/papers/MollerTrumbore97/
It thinks the ray lies in the plane of the triangle, which is of course correct depending on how you look at it.
Just wondering if there's an acceptable way to let this test return TRUE if the ray hits a degenerate triangle.
A degenerate triangle is either a line segment or a single point. So, one way of looking at the "point in degenerate triangle" test is that the point must be on the line segment, or be coincident with the point, that the line segment degenerates to. Problem is, point-on-segment and point-equals-point tests also are subject to floating point precision issues, so these aren't perfect alternate tests either.
So, it can be tricky. My recommendation is to look at Christer Ericson's discussion of achieving robust geometric tests using "thick" primitives. You can find the discussin in his excellent book, Real-Time Collision Detection, or (perhaps in less detail) in his lecture that is part of Jim van Verth's game physics series, presented at the Game Developer's Conference each year and available in powerpoint form here:
GDC Tutorial on game math/physics
So, it can be tricky. My recommendation is to look at Christer Ericson's discussion of achieving robust geometric tests using "thick" primitives. You can find the discussin in his excellent book, Real-Time Collision Detection, or (perhaps in less detail) in his lecture that is part of Jim van Verth's game physics series, presented at the Game Developer's Conference each year and available in powerpoint form here:
GDC Tutorial on game math/physics
Thanks. I should also mention I'm only using this for the 2D case, so if a ray hits a degenerate triangle, it will never lie in the plane,
because all triangles are assumed to be perfectly perpendicular to the ray.
I suppose if the test returns zero, then I will have to default to a PointOnLine test or something.
because all triangles are assumed to be perfectly perpendicular to the ray.
I suppose if the test returns zero, then I will have to default to a PointOnLine test or something.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement