Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

WhittedTracer Class Reference

Class implementing a simple Whitted-style raytracer. More...

#include <whittedtracer.h>

Inherits Raytracer.

Inheritance diagram for WhittedTracer:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 WhittedTracer (Scene *scene, Image *img)
 Creates a Whitted raytracer.
virtual ~WhittedTracer ()
 Destructor.
void computeImage ()
 Raytraces the scene by calling tracePixel() for each pixel in the output image.

Protected Member Functions

Color tracePixel (int x, int y)
 Computes the color of the pixel at (x,y).
Color trace (const Ray &ray, int depth)
 Computes the radiance returned by tracing the ray r.
Color directIllumination (const Intersection &is)
 Computes the direct illumination at a point of intersection by adding the light contribution from each light source in the scene.
Ray getShadowRay (const Intersection &is, PointLight *light) const
 Helper function that sets up a shadow ray from an intersection point to a point light source.
Ray getReflectedRay (const Intersection &is) const
 Helper function that computes the reflected view direction and sets up a ray with the correct parameters.
Ray getRefractedRay (const Intersection &is) const
 Helper function that computes the refracted direction and sets up a ray with the correct parameters.

Protected Attributes

ScenemScene
 Ptr to the scene.
ImagemImage
 Ptr to the output image.
CameramCamera
 Ptr to the camera used for rendering.

Detailed Description

Class implementing a simple Whitted-style raytracer.

The tracePixel() function is called once for each pixel on the screen, and is responsible for computing the output color by tracing a ray through the scene. At each intersection, the contributions from direct illumination, reflection and refraction should be evaluated and summed up.


The documentation for this class was generated from the following files:
Generated on Sun Mar 26 19:14:18 2006 for ASR by  doxygen 1.4.4