15-462 Computer Graphics
Assignment 3 - Mobile Animation
100 points


As discussed in lecture, hierarchical modeling is a powerful tool in computer graphics and animation. In this assignment you will implement a program that animates a rotating mobile suspended from the ceiling. A mobile provides a prototypical example of animation employing hierarchical modeling. You will also experiment with lighting, material properties, and shadows. Besides the code, you are also required to hand in an animation as a sequence of images that your program generates by reading the contents of the frame buffer and then writing it to a file in JPEG format.

We do not specify precisely what the mobile should look like, or which ornaments are suspended from the ends, so there is some artistic freedom in this assignment. Apart from examples provided from last semester's students on the first day of class, see a sample of David Baraff's work on an extremely complex mobile here. For those of you more artistically inclined, you may wish to look up the work of Alexander Calder.

Functionality Requirements

  • Your mobile should have at least 5 endpoints decorated with some three-dimensional ornaments. You are permitted to use any GLU quadrics or other GLUT objects, with the exception of teapots. This constraint is being enforced to ensure that we don't end up with the entire class using glutTeapot() for an ornament on their mobiles.
  • Your mobile should be physically accurate to the extent that it is balanced. You may neglect the weights of the supporting structure. You do not need to perform any collision detection.
  • Your mobile should be represented as a hierarchical object, implemented using display lists.
  • You should render (a portion of) the ceiling to which the top of the mobile is attached.
  • One should have a perspective view of the mobile from some point lower than the ceiling.

Lighting and Material Properties

  • You should illuminate your scene with at least one light source to emphasize the three-dimensional nature of your ornaments. In addition there should be enough ambient light to soften the contrasts.
  • You should use smooth shading for your three-dimensional ornaments.
  • You should position the light source(s) to throw shadows on the ceiling (and/or the walls, if your scene contains any). Implementing shadows is an open-ended problem, and we would like to see you put some thought into this part of the assignment before the implementation stage. It is important to document how you solved this problem in your README file; this is especially crucial if you've done something spectacular for which you want to receive extra credit!
  • You may draw the supporting structure (horizontal bars and vertical threads) as lines. Only the ornaments need need to throw a shadow.


  • If geometrically appropriate, the suspended ornaments should rotate around a vertical axis through their point of attachment.
  • The angular velocity of each rotating object should vary smoothly over time, at least in part randomly.
  • Your program mobile should be able to run in two modes. It should recognize a command line switch -view or -movie to select between display and movie mode.
  • View mode: create a large window, possibly the root window, and animate your mobile. Your animation should timed so that the mobile rotates at a slow, mesmerizing pace in display mode.
  • Movie mode: Your program should create files 00.jpg ... 89.jpg in a subdirectory movie/. Each JPEG file should contain one frame of size 640x480 which, when played in succession with the command animate *.jpg shows your rotating mobile. You should count on a frame rate of 15 frames/second. Please make sure to adjust your initial conditions so that your animation actually displays your mobile rotating within the 90 frames provided.
  • If you're having problems with AFS quota space while creating the animation, you could write your animation frames out to your handin directory directly.


  • Model: proper hierarchical modeling, effective use of display lists, physical realism, aesthetic appeal.
  • Lighting: proper lighting, appropriate surface normals for shading, correct calculation and rendering of fake shadows, artistic impression.
  • Animation: proper rotation, smooth change in angular velocity for each rotating object, reasonable view in both display and movie modes.
  • Style: appropriate use of OpenGL features, properly structured program with good code documentation.


  • Use texture mapping on ornaments to increase realism or visual appeal.
  • Allow interaction with the mobile using the mouse.
  • Support change of viewpoint in your scene using mouse.
  • Allow for soft shadows on the ceiling/walls
  • Elaborately modelled objects on the mobile: For those of you curious about how to model very complicated objects, a frequently used approach is to use a commercial package, such as 3D Studio Max or Maya to model the object and then import it for use within OpenGL. The most common problem with this approach is finding the right plug-in that will massage the scene file into a format that is amenable to your OpenGL program. Maya, from Alias|Wavefront, is available on the WeH 5336 graphics cluster machines. ("maya&")


  • Start your assignment early: this is significantly more complex than Assignment 1.
  • Implement your code in stages: basic model, animation, lighting, shadows, any possible extras. This will limit your risk and guarantee partial credit if you happen to get stuck on any particular part of the assignment.
  • Use your imagination to create an interesting model, but make sure a basic model works first.

Further Information

There is no starter code, but you should reuse the image reading and writing library from assignment 1. A code snippet shows one way to read pixels from the frame buffer in OpenGL and write them to a file.


Please submit your code along with your makefile and any other files used (images, etc) to /afs/andrew/scs/cs/15-462/students/your_andrew_id/, in a sub-directory called asst3. Running "make" in this directory should compile your program successfully, and your program should function properly when run from this directory--if not, you've left out a necessary file. Within this directory, make a sub-directory called movie, and place the frames for your animation within, numbered as described above.

As mentioned above, do not forget to include a README file with your submission, documenting your solution to implementing shadows, and also any extra credit features. Any undocumented extra credit will be ignored.

Please adhere exactly to the guidelines for directory and file names for your program and your images. We will be generating a class movie with your image files, and need to run a script on them to do this--for it to work, all names must be uniform.

[ Home | Schedule | Assignments | Software | Resources ]

Frank Pfenning