Virtual Worlds Assignment 2:

Animation and Interaction

Assigned: Friday, February 4, 2000
Due: Tuesday, February 22, 2000

Overview

For this assignment you are going to take the model that you created for homework 1, incorporate it into an OpenGL application, add animation, and eventually a head-mounted display. I have broken the assignment down into several parts, although there are no required deliverables for parts 1-3, only the last one, part 4.
Make sure you read the entire assignment before starting.
This assignment may be fairly time-consuming, but when you are done, you should feel confident enough to start on your term project. As always, start early!

To assist you in completing this assignment, you will have several resources, including sample code provided by students in previous classes. There are links to these resources on the homework help page.

You are certainly welcome to use your own means to reach the final product, e.g., you might use Inventor or Performer for the entire project. If you are familiar with one of these libraries, it might be a good way to go.

1. Convert and View Your Model

To begin with, you should simply become familiar with a procedure for incorporating your homework 1 model into a basic OpenGL viewer program, using for example the GL utility Toolkit GLUT. Your goal for this part should be to allow someone to view your model in an X window from some arbitrary fixed viewpoint. Similar to the simple cube.c program we discussed in class.

One possible approach to getting your model into an OpenGL program is to export your complete AC3D model as a flat list of colored triangles and then read the triangles into your OpenGL program.

After exporting to triangles you should be able to read the triangles into an OpenGL program and assign normals to them. Kenny Hoff has written code to do this and has graciously made his code available to you, the home viewer, at

http://www.cs.unc.edu/~hoff/projects/comp239/trimodel/triangle.html
or locally at
http://www.cs.jhu.edu/~cohen/VW2000/Misc/HoffTris.tar.gz
There is nothing to turn in for this part of the assignment.

2. Animate Your Model

Once you have the basic framework of the part 1 program with the AC3D-to-OpenGL path working, you need to animate at least one component of your model. If necessary (e.g. if you are using the triangle-export method in part 1 which discards object and hierarchy information), you should break up your AC3D model into distinct components, exporting each to a separate (triangle) file. To accomplish this you can load the entire model into AC3D, delete part of it, export it to a unique triangle file, restore the model and repeat for the other components.

Next, if necessary, you should modify your program from part 1 to read in each of the individual model component files separately, storing each in its own data structure (with which you may store a transformation for the component). Note that when you export or import an individual component, you could choose to transform its vertices so that their origin is local to the component, rather than global to some model coordinate frame. One possibility is to simply translate the individual components to the AC3D origin before exporting them.

Finally, you should add some cyclic motion to your program by translating and (or) rotating the individual model components within some main loop, stepping through the animation with each rendered frame. The final product might show, for example, a rotating telescope that also moves up and down. Of course, it is best if the animation is somehow appropriate for the particular toy you are animating.

There is nothing to turn in for this part of the assignment, although I will want to see the animation functioning in part 4.

3. View With a Head-Mounted Display (Outside-Looking-In)

Here's where the VE rubber hits the road. For this part of the assignment you should further modify your code from parts 1 and 2 to use our Polhemus Fastrak-tracked Virtual Research HMD.

When you are done with this part of the homework someone should be able to, for example, don the HMD and walk around a (scaled) version of your animated model, observing it (in stereo) from different perspectives.

There will be contention for the SGIs and HMD, so don't wait until the last minute to do parts 3 and 4!

You have several resources available to you for this part of the homework. For example, for access to the tracker you will use VRPN. In addition, I am providing you with the nearly complete source code to an HMD application using VRPN. The code is available at:

http://www.cs.jhu.edu/~cohen/VW2000/Misc/hw2sample.tar.gz
(I will be updating this program early next week to to reflect the current tracker location)

I have demonstrated how to compute some of the transformations, such as the room_from_tracker transformation. Using this example, and the descriptive comments, you will need to compute the head_from_head_sensor and eye_from_head transformations. The sample application does transformations using quatlib, a C library which provides vector, quaternion, matrix, and special vector/quaterion transformation types. You are welcome to use quatlib in your applications, but you are certainly welcome to use a different set of transformation routines.

There is nothing to turn in for this part of the assignment.

4. Navigate With the 6-DOF Hand Controller

Finally, you should add the ability to navigate around your model using the 6D "joystick". You should provide, at a minimum, the ability to fly around your model (modifying the room_from_world transformation). You may fly in a gaze-directed style or hand-orientation-directed style, using a button on the joystick to activate the flight. You may need to make and load a simple 3D icon represent your hand in the virtual space. If you wish, you can add zoom (scale user/world), etc. Your final product should allow a user to don the HMD and navigate about your animated model, viewing it from arbitrary points in space.

For part 4 of the assignment you should provide me with the final executable that allows me to view your animated (moving) model with the HMD, in stereo, using the hand controller.

What/How to Turn In

Your grade for the assignment will come primarily from a demonstration of the final product from part 4.
E-mail me a single .zip file (uuencode the file or do mime attachment) containing the following:
 
  • you source code and data files (better use relative paths to your data files!)
  • compiled executable + instructions for compiling
  • instructions for executing the program
  • instructions for interacting within the program
  • I will either test the programs myself or schedule demonstrations.

    As always, have fun!



    Home
    February 7, 2000