Date: Mon, 16 Dec 1996 22:11:15 GMT Server: NCSA/1.5 Content-type: text/html Last-modified: Wed, 06 Mar 1996 18:11:51 GMT Content-length: 4855
This exercise introduces the concept of a "virtual camera". The virtual camera
is a set of transforms which takes a 3D representation of a set of objects
and arranges for them to be shown in a 2D window.
By analogy, a 35mm film camera transforms the 3D world into a fixed size (35mm)
image, viewed from a certain point, with a certain focal length of lens. For
a virtual camera we will need to specify where the camera is, where it is
pointed, the width of the field of the camera, and perhaps other parameters
which a real camera cannot have (e.g. clip planes, or variable aspect ratio).
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.
Open the program CameraIntro.net and its control panel. When you execute it you will see that two image windows are opened. One is controlled by the familiar Image module. The other is controlled by a Camera and Display module. The Camera module gives you explicit control of the viewing parameters. Whereas the image module always points at the scene (by default), an explicit Camera can point anywhere you want and can be controlled by the program itself. On the control panel, switch the selectors to the Animate position and run the sequencer. The position of the Camera (the "from" parameter) and the up direction are now a function of time. The contents of the two compute modules which control the camera are shown here.
Bugs found as of 2/23/96
Model a TV sitting on a table next to a simple still life. Model a TV camera floating in space (chassis, lens tube, lens). Define interactors to control the position, look-to point, up direction, and zoom angle of the TV camera. Use these interactors to orient the TV camera in space and to control a Camera module to produce the image the TV camera would see. Put the image on the front of the modeled TV as shown in the image below. (The cameraINscene program "mirror" is very similar to the TV set.) You will need to convert the control interactors into rotations and translations of the TV camera. The Transform module allows you to rotate by an arbitrary set of basis vectors. A program fragment helps to explain how to take the three input vectors (to, from, up) and convert them to a camera rotation matrix. Your program does not need to show the recursive image if the camera happens to be looking at the TV screen. (See image below, right.) It is more important to be able to control the camera in space and show the resulting image than to make a fancy TV set or camera model.
Be prepared to demo your TV program during section for a maximum of 15 minutes. You will be graded on the correctness of the camera control and the readability of the program.
You must document your code! Layout small groups of modules which fit on one screen and connect them to other groups with transmitters. You should use transmitters/receivers, macros, and comments in the "Notation" field of each module so that you and the grader can understand the program. Control panels, if any, should be well organized, labeled, and with the appropriate numeric ranges.
The Lab 4 grading guide will be filled out by a consultant during section to evaluate your work.