Project 4


Project description, v. 3 (old v. 2) (old v. 1)
Virtual trackball notes

A note on Transforms

The parser code has just (4/01) been updated with different interfaces for Transforms. Instead of having 3 subinterfaces (Scale, Translate, Rotate), there is one Transform interface with setter methods (setTranslate, setScale, setRotate, and setMatrix). Although the name of the methods is setX, the intended behavior is that a Transform should maintain a transformation matrix (initialized to identity) and multiply its current matrix by the appropriate transformation. Thus a new Transform which is called like this
 
setTranslate(-1,0,0); 
setScale (10,5,10); 
setTranslate(1,0,0) 
would have the effect of translating, then scaling, then translating back. The same applies for the setRotate and setMatrix calls. The setRotate call takes an array of 4 doubles. The first 3 doubles represent an axis around which to rotate (unnormalized) and the fourth double is the angle to rotate in degrees (be careful if you're using the Vecmath AxisAngle4d, as this takes an angle in radians). The setMatrix call takes an array of 16 doubles and represents a transformation matrix in row-major order (the first 4 values are the first row, next 4 values are the second row, and so on).

Parsing

In this assignment, you will be reading in model files and displaying them in your modeler. These model files will be in XML. We are providing you with parser code to read in the XML and create your classes based on the file content. In order to use the parser, you need to do the following:

Some hints on parsing


Sample files

Here are some sample files you can use to test parsing: The Bunny and Buddha models are courtesy of the Stanford Scanned Data Repository. The Horse model is courtesy of the Georgia Tech Large Geometric Models Archive.

Watch this location for additional test files to be posted.


Submission Instructions

The submission procedure is similar to that used for Project 1. However, this time there will be point penalties for not following the procedure.
Your project must have the following file structure:
cs418/*/*.java
cs418/*/*.class
cs418/Main.class
That is, a cs418 directory with subdirectories beneath it. Each java file must have a corresponding class file within the same directory. In addition, you must have a cs418.Main class. This is the class we will be calling in order to run your project. If you want, you can just have this class call your real main method somewhere else in your project (this is probably a good idea, since you will have different entry points into your project as the project evolves over the semester). You will create a submission.jar file as you did for the last project, by first changing into the directory above the cs418 subdirectory and executing
jar cvf submission.jar cs418
You will then submit this file using the web interface. You may submit multiple times, but only the last submission counts. We will be using the following command to run and grade your project:
java -cp submission.jar;gl4java.jar;vecmath.jar;parser.jar cs418.Main
Try running this at least a couple of hours before the submission deadline. If this does not start up your project, you will lose a significant number of points on your assignment. We will have gl4java.jar, vecmath.jar, and parser.jar, so there is no need to submit these. Also, the gl4java dll will be in our PATH.