#### Archived

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.

## 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 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;
C=A+V*t;

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 on other sites
Thanks, Trienco. I know this method.
I need faster for realtime.
Store precalculated data is not a problem.

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

1. 1
Rutin
45
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632998
• Total Posts
3009811
• ### Who's Online (See full list)

There are no registered users currently online

×