Part IA Michaelmas Term
Ray Equation
Ray Representation
A ray is represented parametrically as:
where:
- is the ray origin (starting point)
- is the direction vector (typically normalised)
- is the parameter measuring distance along the ray
Properties
- For : (origin)
- For : Points along the ray in direction
- Negative values are invalid (behind the origin)
Constructing Rays from Camera
For a pixel at screen coordinates :
- Compute the world-space position of the pixel on the image plane
- Direction:
Why Parametric?
The parametric form is ideal for intersection testing:
- Substitute into the surface equation
- Solve for (the distance to intersection)
- IF , the intersection is in front of the ray origin
Summary
- A ray is defined by origin and direction
- The parameter gives distance along the ray
- Parametric form enables algebraic intersection calculations