University of California, Berkeley
EECS Dept, CS Division
Jordan Smith SLIDE: Scene Language for
Interactive Dynamic Environments
Prof. Carlo H. Séquin

Home Goals Publications People Gallery Assignments Distributions

SLIDE Implementation Specification

SLIDE Class Hierarchy

The following is a diagram of the SLIDE C++ class hierarchy. Subclasses point up to their superclasses. Every textual SLIDE language element has a corresponding C++ class which represents its type in the run time viewer program. Notice that most SLIDE types are directly or indirectly a subclass of CSLIDEPrimitive.

Notice that CSLIDEObject, CSLIDEGroup, and CSLIDEInstance all share a common superclass, CSLIDENode. This common CSLIDENode type eases the management of the scene graph DAG.

Notice that CSLIDERotate, CSLIDEScale, and CSLIDETranslate all share a common superclass, CSLIDETransform. This common CSLIDETransform type eases the management of transforms in the CSLIDEInstance class.

The classes which appear in red have had portions of their implementations removed. You need to complete the functionality of these classes.

CScanConverter

Grab your implementation of CScanConverter from as7, and modify the FillPolygon procedure to do Gouraud Shading color interpolation. You can compare your results to OpenGL.

CSLIDEPoint

Implement point colors specified by assigning a CSLIDESurface to a CSLIDEPoint. If a surface is specified and the shading flag is SLF_GOURAUD, then the color of this surface should be used at the point. If the shading flag is SLF_FLAT or SLF_WIRE, then the surface color specified at the face should override the point's surface color.

Implement point normals. This includes normals specified in the SLIDE description as well as normals which must be calculated by averaging the normals of the faces adjacent to the point. If the normals of these faces change dynamically, then the point normal will need to be dynamically updated.

CSLIDEFace

When creating the vertices (Vertex objects) which make up the polygon contour, you must set the color correctly based on the face surface, the point surfaces, and the SLIDE shading flag. This should also call the lighting calculations if lighting is enabled.

The face is also involved in calculating point normals.

CBound

Modify the polygon clipping routine to interpolate the color values between vertices when an edge is clipped.

Vertex

Fix the rendering code to set the OpenGL color correctly when using OpenGL's polygon fill method, instead of your scan conversion code. OpenGL will allow you to interactively check your lighting calculations, where as your scan conversion code will be less than interactive.

CSLIDEObject, CSLIDEGroup, and CSLIDEInstance

Implement the SLIDE shading flags in the rendering pass.

CSLIDERender

Implement the lighting setup in the Render procedure. This is similar to what is done with the camera. For each light compute the GLight<-VRC trasform and store it in the CSLIDELightPath to be passed done to the face in the render pass. The face will then call apon the different lights to illuminate the geometry and add their contributions. The calculation of the contribution will be done locally within the light's coordinate system.

CSLIDELightPath

This stores the GLight<-VRC for each illumating entity. There is a unique light path for each light source of a SLIDE Render statement, where as a CSLIDELight may be referenced multiple times in a single SLIDE Render.

CSLIDELight

The light entity is responsible for calculating the color contribution of the light to a point which has been transformed into its local coordinate system.

Outline of Viewer Execution

For more information and diagrams checkout the SLIDE Rendering Pipeline Page. Note: Ignore the rendering pass described there and follow the one described at the bottom of this page instead.

Render

The following graph shows what should be happening for a single face in the rendering process, starting with the HandleDisplay callback on the CWindow object. Note that the matrix notation used in the diagram is ROW VECTOR form, and you will be coding COLUMN VECTORS in the project. The red blocks indicate which portions of the rendering pipeline have changed since the last assignment. These are the ones which you will be creating.

You can also download the postscript version of this graph: render.ps

Suggested Plan of Attack

  1. Get the Gouraud Shading code working without Lighting Calculations ( to test this you can specify different colors at the vertices of a polygon )
    1. Implement the SLIDE Shading Flags in the object/group hierarchy
    2. Fix CSLIDEFace to correctly color the vertices of the polygon contour list which it makes
    3. Fix the Polygon Clipping code to calculate the color value at edge intersection points
    4. Fix the CScanConverter to incrementally interpolate the color values while scan converting
  2. Get the Lighting Calculations working
    1. Fix the CSLIDEPoint normal calculation code
    2. Fix CSLIDERender to pass the CSLIDELights down the rendering hierarchy
    3. Fix CSLIDEFace to use the CSLIDELights when calculating vertex colors



This page was originally built by Jordan Smith.

Last modified: Sunday, 28-Mar-1999 21:37:11 PST