Date: Mon, 16 Dec 1996 22:11:00 GMT Server: NCSA/1.5 Content-type: text/html Last-modified: Fri, 09 Feb 1996 12:53:33 GMT Content-length: 3836
In this exercise you will rewrite the camera transforms which DX uses inside the Image module.
You will write the transform Tview*Tpers and apply it to a few simple objects.
The resulting program will allow you to view the objects in world, view, and
screen coordinates.
Procedure:
First you need to download several example files. To do this, click on each of the filenames shown below. When the text window opens, use the "save as" option to put the file in your own directory. Name each file with the same name as shown below.
Part 1: CameraTemplate.net constructs a simple object made of two cubes and a few spheres (see Images ). Fill in the formulas in the compute modules to simulate the Tview and Tpers matrices given in class and in Watt pages 64 and 73. Note that DX used a right-handed display system, so you will have to negate the x view coordinate. Notice that the program computes N, V, and U vectors for you based on the values of the interactors. Note that the images (with the exeception of the world image) are incorrect until you fill in the compute modules!
Part 2: Add an interactor which independently (of window height) sets the width of the view window. Note that this operation will distort the picture because it maps a rectangular region to a square.
Part 3: Convert the viewing frustrum given in the program from view coordinates back to world coordinates (using an inverse camera transform) and collect it with the original objects so that the viewpoint and viewing frustrum are visible in the world coordinate Image window.
There are three Image modules and one Display module so that you can see the world, view, and screen coordinate systems, plus the final view of the object. The Camera-Display modules are hardcoded to view the computed perspective from the correct angle.
The following images are an example of what the program should produce.
View Coordinates
Screen Coordinates
Screen Projection
Questions/Writeup: