The RayTracer

design and implementation by Kenny Hoff
 

Source Code

Sample Output with Explanations

 
8 spheres, two infinite planes, one point light source of maximum intensity, diffuse reflection illumination model, grayscale (64 shades), no shadows, no dithering (none of these images are dithered). 
 
27 spheres, two infinite planes, one point light source of maximum intensity (above and to the right of the viewer), diffuse reflection illumination model, grayscale (64 shades), shadows. 
 
27 spheres, two infinite planes, two point light sources of maximum intensity (above and to the right and to the left of the viewer), diffuse reflection illumination model, grayscale (64 shades), shadows. 
 
Same as previous except that the light sources were moved towards the objects in the viewing direction (notice the shift in the shadows), 9 more spheres were added, and the distance of the eye to the viewplane was increased (notice the proportion correction, the previous images had the eye too close to the viewplane that made spheres look malformed). 
 
36 spheres, two infinite planes, one point light sources of medium intensity (up and to the right of the viewer), one directional light source (point light source at infinity, up and to the left), diffuse reflection illumination model, grayscale (64 shades), shadows. Notice the even distribution of shadows and light from the directional light source. 
 
22 spheres, four infinite planes, three point light sources of low, medium and high intensity (both are in the scene near the objects to the right of the viewer), diffuse reflection illumination model, grayscale (64 shades), shadows. Notice the varying shadow patterns (including shadow from sphere obscured by center sphere). 
 
Same as previous, except color was added (64 shades of red, green, blue, and gray). 
 
Same as previous, except arbitrary camera model was added (defined by a camera origin, view reference point, and view up vector). 
 
Camera model applied to previous 36 spheres example. 
 
Specular reflection and ambient lighting terms added to the illumination model. RayTracing script rendering script file implemented. 24-bit color model. One point light source (notice the single specular highlight) 
 
Same as previous except there are two point light sources of different intensity (notice two specular highlights, one more prominent than the other). 
 
Same as previous except there are three point light sources of different intensity, and the camera has been moved forward. 
 
Same scene, but the camera has been moved back to show the surround effect of the different light sources. 
 
Same scene with the camera moved forward. The walls and spheres have exchanged their colors. Most notable, however, is that that camera has been given a slightly larger vertical field-of-view without altering the horizontal.