Part IA Michaelmas Term
Ray-Object Intersections
Intersection Testing
Finding where a ray hits geometric objects is fundamental to ray tracing.
Ray-Sphere Intersection
Given:
- Ray:
- Sphere:
Substituting the ray equation:
This is a quadratic in :
where:
Discriminant
The discriminant determines intersection type:
- : No intersection (miss)
- : Tangent (one intersection)
- : Two intersections (enter and exit)
Solutions
The closest valid intersection is the smallest positive .
Ray-Plane Intersection
Given:
- Ray:
- Plane:
where is the plane normal and is the distance offset.
Substituting:
Valid if:
- (intersection in front of origin)
- (ray not parallel to plane)
Ray-Polygon Intersection
For a polygon:
- Intersect the ray with the plane containing the polygon
- Check if the intersection point lies inside the polygon (2D geometry test)
For a disc: Check if distance from centre is less than radius.
Ray-Cone Intersection (2022 Paper 3 Question 3)
For a cone with apex at origin, base radius , height , axis along :
Implicit equation:
Intersection Method
- Base: Intersect ray with plane ; accept if
- Side: Substitute ray into implicit equation, solve quadratic in
Normal Calculation
For a point on the cone side, the normal is proportional to:
The normal is the gradient of the implicit function .
Transformed Objects
For an object transformed by matrix :
- Transform the ray by
- Intersect with the canonical (untransformed) object
- Transform the intersection point back by
- Transform the normal by
Summary
- Ray-sphere intersection reduces to a quadratic equation
- Ray-plane intersection is a simple division
- Polygon intersections require inside/outside tests
- Cone normals are computed from the implicit gradient
- Transformed objects require transforming the ray by the inverse matrix
Past Paper Questions
2022 Paper 3 Question 3: Derive the ray-cone intersection. Find the normal at an intersection point.