Jump to content
  • Advertisement
Sign in to follow this  
rosewell

Point in degenerate triangle?

This topic is 3735 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!