Jump to content
  • Advertisement
Sign in to follow this  
broli86

ray-triangle edge intersection

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

How to find out which edge has been intersected by the ray during the ray-triangle intersection procedure if the ray hits an edge. I think one cand etermine if the ray has hit an edge based on the barycentric coordinates - http://upload.wikimedia.org/wikipedia/commons/f/fa/Barycentric_coordi... if any of the 3 barycentric coordinates is 0, then the ray has hit an edge. The question is which edge ? If can make the ray intersect independently against every edge and find the closest intersection but that seems lengthy. Is there a fast check ?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by broli86
How to find out which edge has been intersected by the ray during the
ray-triangle intersection procedure if the ray hits an edge. I think
one cand etermine if the ray has hit an edge based on the barycentric
coordinates -

http://upload.wikimedia.org/wikipedia/commons/f/fa/Barycentric_coordi...

if any of the 3 barycentric coordinates is 0, then the ray has hit an
edge.

The question is which edge ?

If can make the ray intersect independently against every edge and
find the closest intersection but that seems lengthy. Is there a fast
check ?
Setting aside the fact that the ray is unlikely to exactly intersect an edge of the triangle, you should be able to find the intersected edge as follows (note that this assumes the triangle is not degenerate or ill-formed):

1. Find the barycentric weight (if there is one) for which the magnitude of the value is zero or near zero.

2. The edge is formed by the endpoints corresponding to the other two barycentric weights.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!