Project 9.Creative image:![]() Instancing with 9 samples per pixel. Code listing:Program 9 tarredDesign Choices:The biggest design choice I faced was deciding how to deal with instances of objects. The instance's normal function needs to call the normal function of a primitive. So, it makes sense to have a primitive*. However, we want to have instances of objects (the GriddedGroup object for example). So, I decided that the instance class should have an Object* and a Primitive*. The Object* points to the Object (or Primitive) that is assigned during initialization. The Primitive* points the intersected Object's most recently hit Primitive. The HitRecord's scratchpad is a bit safer place to store the hit primitive when the HitRecord's hit primitive points to an instance, but the method I used works. Extra Credit:None so far. |