Programming Assignment 4
CS 51580
Computer Graphics
Spring, 2022

This assignment makes use of the files contained in this zip file. This assignment is due Wednesday, May 4.

This assignment is based on Hw3, the hierarchical models that we used in class, and the JOGL texture examples that we did in class.

This assignment uses hierarchical transformations on textured P, N, and W models to create a GUI program. In the zip file there are animation files, hw4_sample_video_1.mp4 and hw4_sample_video_2.mp4, that show you how the GUI should look and work. The GUI has six sliders. The bottom three sliders rotate each of the three letters individually. The top three sliders transform the three letters as a group.

In the zip file there is an outline of a Java program Hw4.java. You should complete this Java program so that it replicates what is shown in the animations.

For the P, N, and W letters, modify with your P.java, N.java, and W.java files from Hw3. You need to add texture coordinates to each vertex in your letter models. Since each letter's model coordinates have 0 <= x <= 1 and 0 <= y <= 1, the texture coordinates of each vertex are the same as the vertex coordinates.

The textures for P and N are texture images created by methods from the file TexturePattern.java, which is included in the zip file. The texture for W is the image file textures\red-brick.jpg from the textures folder in the zip file. Notice that the letters P and N, in addition to having textures, also have the same color that they had in Hw3. But the letter W should use only a texture, without any color.

Each of the three sliders that rotates an individual letter moves the letter in a way similar to how the letter moved in Hw3. In particular, the letter N always rotates around its center point while its center point moves up and down the y-axis.

In the zip file there are three screen shots that give you test cases for checking that your sliders are doing what they should do.

A good stepping stone for this assignment is to go back to your Hw3 code and add textures to the letters in that animation. After you get that animation to run using textures, convert the program from an animation to a GUI using the sliders.

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

This assignment is due Wednesday, May 4.