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.
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.htmlor locally at
http://www.cs.jhu.edu/~cohen/VW2000/Misc/HoffTris.tar.gzThere is nothing to turn in for this part of the assignment.
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.
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:
(I will be updating this program early next week to to reflect the current tracker location)http://www.cs.jhu.edu/~cohen/VW2000/Misc/hw2sample.tar.gz
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.
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.
As always, have fun!