Jump to content
  • Advertisement
Sign in to follow this  
Lode

test if point is inside tetrahedron

This topic is 4697 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

say you have a tetrahedron made out of points a, b, c and d. What's a quick way to test if a 3D point p is inside this figure? Thanks. P.S. It's also fine if the sides ab, ac and ad are made infinitely long so that you get an infinitely large tetrahedron.

Share this post


Link to post
Share on other sites
Advertisement
You have four planes defined by the four cominations of three points. Take each plane equation defined by the normals, and if p lies on the side opposite of the normal for each plan then it's inside the tetrahedron.

Share this post


Link to post
Share on other sites
Given your PS, another thing to do would be to convert the point to barycentric coordinates. If any of the last 3 coordinates is negative, the point is outside the infinitely extended tetrahedron. Additionally, if the first coordinate is negative, the point is outside the original tetrahedron.

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!