This assignment makes use of the files contained in this zip file. This assignment is due Monday, December 1.
This assignment is based on the version of the renderer that implements nested models, basic_renderer_3. In this assignment you will write a program that creates a fairly complicated nested model.
In the zip file there is a demonstration program called Hw4_demo.class
, and a shell script for running it, Run_Hw4_demo.cmd
. Your assignment is to write a program that acts as close as possible to the demo program. In the zip file there is a java file, Hw4.java
that you should complete.
Your solution to this assignment should be a program that creates a nested model that contains three sub-models. One sub-model should contain the six great_rhombicosidodecahedron as sub-models, another sub-model should contain the six horses as sub-models, and the third sub-model should contain the three donuts as sub-models. The first part of the animation rotates the nine sub-models in the xz-plane, one degree per frame, 90 degrees around the y-axis. The second part of the animation rotates the nine sub-models in the xy-plane, one degree per frame, 180 degrees around the x-axis.
You need to figure out what the "scene graph" for this program looks like, and then write the code that builds that scene graph. After the code that builds the scene graph, you need two loops that create the 270 frames of the animation. Each iteration of the loops should update the matrices in the scene graph in an appropriate way.
Here is a suggestion on how to make your code a bit more manageable. There is a total of 15 leaf nodes in the scene graph, one for each sub-model in the animation. It helps to have an array (of size 15) that holds references to these 15 sub-models. That way, you do not have to traverse the tree over and over again to get at each of the leaf nodes (you can just traverse the array).
Feel free to make the animation look better, by say, choosing better looking sub models, finding a better location for the camera, giving the scene some color, etc.
Turn in a zip file called CS455Hw4Surname.zip
(where Surname
is your last name) containing your version of Hw4.java
.
This assignment is due Monday, December 1.