Ray-tracing a CSG solid
- We want to determine where a ray hits a solid.
- Algorithm
- Solve ray intersection for each primitive.
- Result is an (possibly empty) interval for each primitive.
- Apply the CSG set operations on the intervals on the ray.
- Keep track of the nearest point.