This is the second version of a simple ray tracer written here at RPI. The second version expanded its capabilities with the inclusion of distributed ray tracing. Detailed information on what distributed ray tracing is can be found in the paper by Cook, Porter and Carpenter: "Distributed Ray Tracing", ACM Computer Graphics, Vol.18, Num.3, July 1984. New capabilities include: Gloss (blurred reflection), translucency (blurred refraction), penumbras (area light sources), motion blur, square intersection routine and a field of view options. The eye can be in any position now and can look towards any direction. Antialising can also be done using stochastic sampling. The old version was also supporting reflections, refractions and shadows using spheres. Here is a list of the files, and what does each file contain: bg.c: bgcolor() evaluates the background color for a given ray. initialize.c: initialize() does some useful setup. intersect.c: sphere() Intersection routine with a sphere. quad() Intersection routine with a square. intersect() Main intersection routine (calls sphere() ). main.c: main() Main body of the program. readfile.c: readfile() Reads in the input data. shade.c: shadow() Calculates the existance of a shadow ray. reflect() Find the reflection vector. refract() Find the refraction vector. shade() Calculate Phong's shading function. trace.c: quickcos() Calculate a fast cos between 0 and pi / 2. quickinvcos() Calculate a fast inverse cosine. rnd() Random number generator between 0 and 1. rand1() Random number generator between -1 and 1. grand() Approximate gaussian random number generator. sample_ray() Take a ray somewhere inside a solid angle. trace_a_ray() Trace a single ray. trace() Trace a single ray inside a solid angle. raytrace() Ray trace the whole picture. vector.c: vadd() vector addition. vsub() vector subtraction. vneg() vector negation. svproduct() scalar - vector product. vdot() dot product. vcross() cross product. norm() normalize a vector. ray.h: Include file for every file used in the raytracer. vector.h: Include file for every file using vectors. The ray tracer is written so it can be easily understood (at least that version), and it is fully commented. Nevertheless, probably it won't be understood by a newcomer. The format of the input file is as follows: