Space Partitioning: Painter's Algorithm

from back to front, the way you'd paint a wall

The painter's algorithm for rendering a scene renders the objects in the scene from back (farthest from the viewer) to front (nearest to the viewer).  To establish the back-to-front order, the scene is scanned, and as the scanline encounters an object, the object is pushed onto a stack.  The objects are painted as they are popped from the stack.  If the scanline moves from front to back, the objects will be popped off the stack from back to front, thus achieving the painter's ordering.

These movies were made by Donald McElheny, '07, during the summer of 2005.

Three movies are available:  the first two show just three objects; one of these includes pauses to pose questions to the viewer.  The third movie shows five objects.  The scenes in these movies are of two-dimensional objects in a plane.  The rendering is therefore one-dimensional painting on a one-dimensional "canvas."  Although this is not very practical, it serves to illustrate how the algorithm works.  Remember the guidelines for the use of these movies.

Movies

 


View and download: 3 objects (32.7 Mb)


View and download: 3 objects, with questions (32.8 Mb)


View and download: 5 objects (40.9 Mb)

 

©2009 Franklin & Marshall College  |  Lancaster, PA  |  717-291-3911