The unit cylinder is then intersected with this transformed ray. The normal to the unit cylinder at the point of intersection must be transformed by the rotation matrix mentioned above. A sample cylinder Cylinder with spheres and triangles Texture Mapping Texture mapping for spheres and planes were also implemented. The basic steps involved transforming the shape to a canonical cube, and mapping the point of intersection to this canonical cube. Then we multiply this resulting point by the dimensions of the ppm image to yield the position of the pixel that we should acess its color from.
Texture mapping is a very useful method to add detail to the image.
We used the technique from Advanced Animation and Rendering Techniques to implement soft shadows. Our previous method of handling shadows was to check at each pixel to see if anything obstructed each point light in the scene. Since a pixel is either in shadow or not, this method results in hard shadows with a sharp edge. For soft shadows, a light is modelled as a sphere instead of as a single point. At each point, multiple rays that are jittered about the ray to the center of the area light are used to sample the entire light area.