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

Assignment 6: Perspective Projections and Stereo Viewing

Specification

In this assignment, you are building slide3d, a 3D SLIDE viewer which handles parallel and perspective projections and flat shading of convex polygons. You will need to implement the following:

Rendering Options

New options appear in bold.

Perspective Projection Cameras

The camera object must create a projection matrix which maps points in View Reference Coordinates (VRC) to the Canonical Clipping Volume space. Then you will use the viewport mapping transform from the last assignment to map the clipped geometry to the viewport window.

For more information on how to calculate the Gproj<-vrc read perspective projection section of the Camera Projection Notes.

Also look at the old perspective notes.

4D Bounding Box Culling

Extend your bounding box culling routines to work in 4D on homogeneous point values. This ends up being very similar to 3D clipping.

4D Polygon Clipping

Extend your polygon clipping routines to work in 4D on vertices with homogeneous point values. This is very similar to 3D clipping.

Stereo Viewing

You should be able to make a stereo viewer without writing any C++ code. If you make use of multiple viewports, render statements, and cameras in a single SLIDE file you can create the illusion of 3D. For more information on stereo viewing read the Stereo Viewing Notes.

Stereo Viewing

Your stereo viewer can be written entirely in SLIDE with no additional C++ code by appropriate use of the camera, instance, viewport, and render statements

To create a stereoscopic image, you need to render two slightly different images of your object, corresponding to the two views from two eye positions separated in space. Then, display the two views, side by side, on your window. For best results, the object should be about 5 eye-separations in front of the eye pair and have a size smaller than the eye separation.

As an example, the following special setup would achive this goal: Make your object about the size of a unit cube, center it at the origin of the world coordinate system, and place the two eyes at locations (1 0 10) and (-1 0 10) with the instance statement. Choose a clipping window: frustum (-0.2 -0.2 -0.01) (0.2 0.2 100) and display the views from the two cameras side by side in square viewports within a window that is twice as wide as it is tall.

A more correct formulation uses two different oblique cameras that are focused on the same view plane from two different positions.

In this figure, the eye separation is 2a, the distance from your eye to the monitor is v, and the width of the viewport is w. Assume that the viewport has some height, h. You can use those values to set up the camera geometry. For instance, the left eye will have a frustum of (a/v, -h/v, *) ((a+w)/vh/v, *)

Then, when you create your scene, you have to place your left eye camera at (-a, 0, d) in the relative coordinates of your SLIDE world and make sure that your object is centered at the origin. You can calculate the distance to the image plane, d, by computing the intersection of the lines from each eye through the midpoint of their respective viewports, or by computing the intersection of one such line with the midline.


Getting Started

Follow the listed instructions for as6.

Maybe these hints are useful.


SLIDE Implementation Specification

The SLIDE Implementation Specification gives information about the C++ class structure which implements the SLIDE viewer. It also gives an outline of the operation of the viewer.


Submission Details

  1. This assignment is to be done in pairs, with a new partner (note - this is a recent change).
    For later assignments, you can settle down with a partner who you may keep for the rest of the semester.
  2. Follow the listed instructions for as6.



This page was originally built by Jordan Smith.

Last modified: Monday, 18-Oct-2004 19:22:03 PDT