15-462 Computer Graphics I
Assignment 3 - Mobile 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. As an example (which would not score very high),
see a mobile
in the style of Alexander
- Your mobile should have at least 5 endpoints decorated with some
three-dimensional ornaments. You may use GLU quadrics or other GLUT
objects (see below for rendering requirements).
- 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.
- 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
- 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).
Draw them as a projection.
- You may draw the supporting structure (horizontal bars and
vertical threads) as lines. Only the ornaments need need to throw a
- 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
- 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
- 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
- Use texture mapping on ornaments to increase realism or visual
- Allow interaction with the mobile using the mouse.
- Support change of viewpoint in your scene using mouse.
- 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.
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.