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

Raytracer Class Reference

Base class for raytracers, containinng basic functionality needed for implementing various raytracing algorithms (Whitted, Pathtracing). More...

#include <raytracer.h>

Inherited by PathTracer, and WhittedTracer.

Inheritance diagram for Raytracer:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Raytracer (Scene *scene, Image *img)
 Creates a raytracer.
virtual ~Raytracer ()
 Destroys the raytracer and all the objects it contains.
void computeImage ()
 Raytraces the scene by calling tracePixel() for each pixel in the output image.

Protected Member Functions

virtual Color tracePixel (int x, int y)
 Compute the color of the pixel at (x,y) by raytracing.
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

Base class for raytracers, containinng basic functionality needed for implementing various raytracing algorithms (Whitted, Pathtracing).

When the function computeImage() is called, the image is raytraced by calling tracePixel() for each pixel in the output image. A very basic implementation of tracePixel is provided, but to implement more advanced algorithms (Whitted, Pathtracing), the tracePixel() function should be overridden in a sub class.


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