Möller–Trumbore intersection algorithm
The Möller–Trumbore ray-triangle intersection algorithm, named after its inventors Tomas Möller and Ben Trumbore, is a fast method for calculating the intersection of a ray and a triangle in three dimensions without needing precomputation of the plane equation of the plane containing the triangle. Among other uses, it can be used in computer graphics to implement ray tracing computations involving triangle meshes.The following is an implementation of the algorithm in C++:
bool RayIntersectsTriangle
Java implementation
The following is an implementation of the algorithm in Java using javax.vecmath
from Java 3D API:
public class MollerTrumbore
Links