Jump to content
  • Advertisement


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


faster ray-triangle intersect algorithm

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

did anyone can help me with subject? i need method which faster then moller''s and dont need to calculate u, v? i need it only for check is ray hit triangle - not need hit point.

Share this post

Link to post
Share on other sites
hm.. if it wouldnt need all that converting id have said try plücker coords for the triangle edges and a basic plane-distance for.. wait.. ray? then forget the plane intersection and just doing those 3 plücker-dot-products should let you know if the ray is passing inside all three edges if all signs are equal.

if you want to test whole models i wonder if it would work to store in a different way, ie. for each triangle store the three edges as plücker coords and the neighbouring triangle for each edge. with each check you should be able to traverse your models geometry in the right direction.

without knowing what mollers method is i assume its finding the intersection with the plane and doing the three dotproducts with each edges normal? with A being the starting point, N the plane normal and V the direction of A and C the intersection of ray and plane and Px the vertices of the triangle:

float s=N*V;
if (!s) return 0;
float d=N*(P0-A);
float t=d/s;
if (t<0) return 0;

if (P0.normal*(C-P0)) return 0;
if (P1.normal*(C-P1)) return 0;
if (P2.normal*(C-P2)) return 0;
return 1;

without having the normals precalculated you get an additional (Py-Px)xN.

[edited by - Trienco on January 16, 2004 10:36:01 AM]

Share this post

Link to post
Share on other sites
Thanks, Trienco. I know this method.
I need faster for realtime.
Store precalculated data is not a problem.

Share this post

Link to post
Share on other sites
in that case plücker coordinates might be worth a look. but if you find yourself with too many triangles to do it in realtime it always a good moment to use something more elegant than brute-forcing every triangle in the whole world. in other words: there might be much better places to start optimizing than the intersection test.

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.

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!