Archived

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

cignox1

the faster line/triangle intersection

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