CS 45500 - Programming Assignment 4

This assignment makes use of the files contained in this zip file. This assignment is due Friday, December 16.

This assignment uses model transformations, nested models, the Camera's viewLookAt() method, and the oriented Face primitive. This assignment has three parts to it.

In the zip file there is a folder called demo. In that folder there is a file called Run_demo.cmd. If you double click on that file you can run a demo of the program you need to write.

There are two features in the demo program that you need to implement. For the first feature, you need to create a nested PNW.java model out of your P.java, N.java, and W.java models from the previous assignment. Your program should instantiate the nested model and let the user of your program manipulate the nested model. In our interactive programs, we use the keyboard to control the program. For example, the x, y, and z keys move a model in the x, y, and z directions. In your program, the '/' key should cycle through the four models used in the program, the nested PNW model, the P model, the N model and the W model. When a model is chosen, the model manipulation keys should manipulate that chosen model (the model manipulation keys are the keys that translate the model, rotate the model, scale the model, and change the color of the model). Notice that when the PNW model is selected, its three sub-models move together and should remember their relative state within the hierarchical model.

The second feature you need to implement is better camera control. Most of our interactive programs have only allowed the camera to move vertically and horizontally while always looking at the same (fixed) point. In the demo program you can move the camera's location in all three directions, x-direction, y-direction, and z-direction (the arrow keys for up/down, left/right movement, the '<' and '>' keys for forwards/backwards movement). In addition, you can move the point that the camera is looking at. This point should be represented in the scene by a small red sphere. The six keys '[', '{', ']', '}', '\', and '|' should move the look-at point in the x, y, and z directions.

In the zip file there is a program called InteractiveLetterTester.java that you can use to examine and manipulate your P, N, W, and PNW models. You should also use this file as your starting point for this assignment. Make a copy of this file and rename the copy PNWBuilder.java. Then add to PNWBuilder.java the two features described above.

Also in the zip file there is a model file P_faces.java that models the letter P using oriented faces. After you have the above two parts of this assignment working, convert your P, N and W models to use oriented Face primitives (instead of LineSegmentall of the faces oriented in the same direction (use CCW, counter-clock-wise). If a face ends up with the opposite orientation, then it disappears when it should be visible, and is visible when it should be hidden.

This assignment is worth 30 points. The first feature, the manipulation of the four models, is worth 15 points. The second feature, the camera manipulation, is worth 10 points. The third feature, using oriented faces, is worth 5 points.

Since this asignment replaces an exam, here is a new grade distribution for this course (that replaces the grade distribution given in the syllabus). Your grade for this course will be based on the exam and the four programming assignments in the following manner:

           30%    1st exam,
           25%    this assignment,
           15%    assignment 1,
           15%    assignment 2,
           15%    assignment 3.

Turn in a zip file called CS455Hw4Surname.zip (where Surname is your last name) containing your versions of P.java, N.java, W.java, PNW.java and PNWBuilder.java.

This assignment is due Friday, December 16.