To become familiar with hierarchical coordinate systems.
Write a Java program using GL4Java that displays a graphical scene containing 7 objects: 1 sphere, 2 cubes and 4 teapots.
The objects should be arranged in a tree layout in the Z=0 plane, with the sphere at the root of the tree (positioned on the positive Y axis), the 2 cubes the next level down (children of the sphere, positioned at Y=0, and +/- X from the sphere), and the 4 teapots at the leaves (two as children of each cube, positioned at negative Y, and +/- X from their parent cube). The objects should be of similar size, and spaced so they are near each other but not overlapping.
A 45 degree field of view perspective projection should be used to view the scene, with the camera on the +Z axis, looking at the origin, far enough away so the entire scene is visible.
Each object should be a different subdued, pastel color; use any colors except yellow and green.
At any time, one of the objects should be "selected"; initially, the sphere should be selected. While an object is selected, it should be bright yellow. The selected objects can be changed using the "n" (next) and "p" (previous) keys. Pressing these keys cycles the selection through the 7 objects.
In addition to selecting an object, the user can put your program in a number of different transformation modes, which are selected by pressing a key: "s" (uniform scale in x, y and z), "x" (rotate around the x axis), "y" (rotate around the y axis) and "z" (rotate around the z axis). You should draw some text in the upper left corner of the window, telling the user what mode they are in.
When the users presses the left mouse button, drags the mouse, and releases it, transformations are applied to the scene as follows:
Pressing the "r" key should reset the transformations on all objects to their initial position.
Your program should consist of a single java file which should be commented with your name (the name you are registered under!) and GT number. The java file should implement a class "a2" (so the TA can execute it using the command "java a2".) The file should be emailed as an attachment to a single email message to email@example.com.
The time the mail is received will be used to determine whether or not the program is late, so be sure to allow a couple of minutes for the mail system to transmit your file if you are working right up to the deadline.
IMPORTANT: If the TA has to edit your files you will lose points. Similarly, the TA should be able to execute the class "a2", so using any other class as your main class will result in lost points.
This program is due on or before class on Tuesday, September 24th. This means it must be received by 9:39am EDT on Tuesday to not be considered late.
You might want to start with this sample file hw2.java. It sets up some lighting and shows you how to draw a some objects with GLUT.
You are expected to read the OpenGL docuementation to see how to create projects, position the camera, draw text, and manipulate the matrix stacks.
There are two extra credit options on this assignment. You may do one or both, and each is worth a possible one point.