Next: Solid Texture Mapping Up: Algorithms Previous: Refraction

Constructive Solid Geometry

To implement Constructive Solid Geometry (CSG), I added two new object types to Gn. These objects were used to implement intersection and difference operations. They work similarly to the instance object type in that their objects only contain pointers to left and right subtrees, which will be used to perform the desired operation. These operations depend upon the assumption that the intersection code for individual objects (i.e., cubes, spheres, cylinders, cones) returns the intersection points and normals at those points for where the ray enters and exits the object. With this information, I was able to use the methodology from [Hearn &Baker 1994] for computing the new intersection points and normals for the CSG object.

The source for CSG calculations can be found in the file intersect.c, in the functions CSGdifference and CSGintersection.


awscreen@noether.math.uwaterloo.ca
Wed Aug 2 20:30:34 EDT 1995