Assignment 2: 3D Graphics with OpenGL
Due Wed. 17 October 2005

The purpose of this assignment is for you to begin to use real-time graphics for 3D viewing, manipulation of objects, and understand some of the purposes of affine math and different frames.

The below table lists the various parts of this assignment. Each part is assigned a certain number of points. Full completion of a portion is the only way to receive any of the points for that portion. Those parts with an asterisk (*) in the first column are required and MUST be done for the project to be passed off. The remaining portions are optional, although you must tally 400 points over the 4 projects for this class. The maximum which may be received for any single project is 120.

As a part of this assignment, you will need to have at least 2 3D primitives in your scene. You must leave the object in its modelling frame in your code and use OpenGL function calls in order to move, rotate and scale the object into its world coordinate location.

Required Description Point Value
* Display a 3-dimensional manifold object (i.e. fully encloses a volume)

Cubes, spheres, tetrahedra and other Euclidean primitives are examples.

5
  As an enhancement to the above requirement, read in polygonal models from a standard file format. (PLY, TRI explained here)

You must write your own code for this portion of the assignment. (i.e. you can’t use any of the available 3D Model Readers.)

A few sample models can be found here.

15
* One of the following viewing modes. You may use any of the GL/GLU viewing functions.

NOTE: These are not mutually exclusive options. You could implement all of them!

 
  Fix the camera on the z=0 plane, with the viewer looking down the -z axis. Based on user input, allow the camera to move along the z=0 plane (although the view direction is still the -z direction). 10
  Fix the location of the camera. Based on user input, allow the camera to view in different directions. This is equivalent to standing still and pivoting at your neck. 15
  Fix the view direction of the camera. Based on user input, allow the camera to move along the axis of the camera’s view direction. This is a form of zoom in/out. 15
  Fix a center point in your scene. Given the current location of the camera, you can find the radius of a sphere around that center. Based on user input, you need to allow the user to move along the surface of that sphere. You’ll want to use two angles as described in the text (see p. 55). The text assumes a radius of 1 there. 20
* Any of the following animation via affine transforms choices. In all choices, the animation could be caused by user input or scripted.

NOTE: These are not mutually exclusive options. You could implement all of them!

EXTRA POINTS are available for particularly interesting or complex animations!

 
  Load two 3D objects that touch along a line. Have them hinge at that line. An example would be the lower and upper jaw files. Have them hinge as if they were in a talking mouth. This could also be done just with two cubes on sitting top of each other. 15
  Load n (n >= 2) 3D objects. Have them all rotate around their own respective centers using different rotation axis (i.e. e1, e2, e3, or other axis). Make sure they are all visible at once on the screen. (10 + (5*(n-2))) : max 25
  Load n (n >= 2) 3D objects. Have them all expand and contract around their own respective centers. Make sure they do not expand into their neighbors. (10 + (5*(n-2))) : max 25
  Propose some other affine animation to me. Points negotiable.
  End Affine Transforms Section You must do one of the things above this point but below the above star  
  Allow the user to interactively move the front and back clipping planes. You should have a minimum and maximum value which cannot be exceeded to prevent division by zero, etc.

This functionality allows the user to explore models by moving the near plane through an object, and watch as it cuts equal distance swaths from the geometry. Similarly, once a hole is created in the front, it can be interesting to move the back plane so that you can see through an object.

15
  Expand any game from the first assignment to be 3D. Make sure the camera location is NOT static (else why go to 3D?). If the camera location is controlled by the computer, make sure they move logically: i.e. always behind the paddle that the ball is coming toward in PONG. If the user manipulates the view, make sure it is possible to manipulate the view and continue to play!

It is always better not to jump the camera so much that it is no longer a smooth animation.

10-50
  Lighting - these will require adding GLLights.  
  Calculate the per-triangle normals of the objects read in by a file. Draw the object flat shaded. 15
  Calculate the per-vertex normals of the objects read in by a file. Draw the object Gouraud shaded.
NOTE: This has to work for GENERAL models, not for some specific case like a sphere. This is quite a piece of coding, hence the large point award.
25
  UI Points. In this assignment, you have a choice of how the user interacts with the camera, animation and game. As the quality of the user interface increases, your points in this area increase. In order to get any of these points, I will be the one using your UI for the pass off. If I can navigate everything smoothly, you get the full points. Less will be awarded for lesser interfaces. You may want to look into drop-down menus, buttons, mouse events, etc.

These points will be less freely given than in assignment 1.

0-15