A ray starts at a point P and extends indefinitely in direction d. Its parametric form is R = P + td, with t >= 0; restricting t to nonnegative values distinguishes the ray from the whole line. section 3.8.2
In 3D geometry, rays provide a practical way to test whether directed paths meet triangles. Raytracers emit one ray per screen pixel, while collision systems use similar tests against triangle meshes. section 3.8.1
A ray-triangle intersection test combines two parameterizations:
- Parameterize the ray as R = P + td, allowing t to range from zero toward infinity. section 3.8.2
- Parameterize a triangle ABC as S = A + uAB + vAC, then reject plane points that fall outside the triangle. section 3.8.2
- Solve the resulting linear system to determine whether the ray reaches the triangle and where the intersection occurs. section 3.10
Testing a directed path
For a ray beginning at P = (0.5, 0.5, 0.5, 1) with direction d = (0, 0, 0, -1), the supplied test reports a true intersection condition; reversing the direction to (0, 0, 0, 1) reports false. section 3.10
Use the figure to compare a ray that intersects a 3D triangle with one that misses it. section 3.8.1
