Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

cignox1

the faster line/triangle intersection

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

Hi, I need the faster line/triangle intersection algorithm. I found something nice some time ago but now I don''t to know the actual intersection point: just if a intersection happened. I guess that there is an ultra-fast algorithm (faster than simply exclude the last section of the common one) but I did not find it. Could someone help me, please?

Share this post


Link to post
Share on other sites
Advertisement
Hi, I need the faster line/triangle intersection algorithm.

Faster than what? What method are you using now?

Pluecker coords are pretty fast, but IIRC they won''t give you 3D coords directly.
You could just do the old-fashioned line-plane intersection test to find the point at which the line intersects the plane of the triangle. Then take the cross product from the point of intersection with all the triangle vertices in same order (i.e. clock-wise or counter-clock-wise) and if the results of the three cross products are all the same sign, then your point of intersection is in the triangle.

http://astronomy.swin.edu.au/~pbourke/geometry/planeline/

Share this post


Link to post
Share on other sites
How about this?

http://geometryalgorithms.com/Archive/algorithm_0105/algorithm_0105.htm

I used it in a ray tracer for a school project and it worked pretty quickly.

Kev

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i managed to get one like the one described done in 42 floating point ops if i recall correctly, that did give the point of intersection. it required an extra 4 bytes per triangle over and above just the vertex indices though and was only suitable for static geometry.

Share this post


Link to post
Share on other sites

  • 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!