CS 4451, Fall 2003

Project 2: OpenGL Animation

Due: Friday, October 3, 2003, 11:59pm


Overview

The goal of this assignment is to create an animated scene using the OpenGL graphics library. Because you will be using OpenGL routines, your code should run fast enough on a PC for you to have images generated at several frames per second.

Objectives

You will write a program that, when executed, will draw a series of images that make up a short animation. You will use OpenGL to do all of the drawing.

Your images will contain several objects of your own choosing. These objects can be created in either of two ways. First, you can write special-purpose code to draw objects such as a cube, cylinder, cone or sphere. Second, it is fine for you to use models that you read in from a file. We do not care where these model files come from so long as you are not violating any copyright laws. The purpose of this assignment is to piece together and animate a scene containing several objects, and we do not want this assignment to be difficult in terms of creating the objects. Here are the items that must be demonstrated by your program:

We will be looking for each the above items in your animation program. Missing any of the above elements will cause a deduction in your grade for this assignment.

To grade this assignment we will be compiling and linking your code on a Windows PC. It is important that you fully test your code on a PC to make sure it works, but you can develop your code on other platforms such as SGI's if you like.

Provided Code and Suggestions

We provide for you two example programs that creates a window and uses OpenGL to draw simple scenes. Both of these examples can be found in the directory ~turk/public/cs4451/prog2. This code is set up to run using Microsoft Visual Studio 6, which you can run on the CoC Intel cluster. There is a file called "README.txt" in this directory that gives details to compile the code.

The program called "square.c" creates a rotating white square. The program called "animation.c" shows a rotating cube in front of a shiny sphere. Feel free to use these programs as a starting point for this assignment. The program "animation.c" is probably a better starting point because it uses perspective projection, z-buffering and a light source. The "square.c" program is more simple, however, and is a bare-bones illustration of a simple OpenGL program.

You will find that it is easiest to incorporate both camera and object motion by creating a single parameter that is your "clock". You might, for example, create a variable called "frame_count" that begins at zero and is incremented after every frame. You can then deduce the camera position and the object animation from this variable.

Your main references for this assignment will be the OpenGL Programming Guide and the OpenGL Reference Manual, and links to both can be found on our class web page.

Authorship Rules

The code that you turn in must be your own. You are allowed to talk to other members of the class and to the instructor about general implementation of the routines for the assignment. It is also fine to seek the help of others for general C or C++ programming and makefile questions. You may not, however, use code that anyone other than yourself has written. Code that is explicitly not allowed includes code taken from the Web, from books, from previous assignments or from any source other than yourself. The only two exceptions to this rule is that you should feel free to begin with the sample code that we provide and you may also use code written by others to read in individual object geometry (such as collections of polygons). Your scene assembly code and animation code should be your own. You should not show your code to other students. If you need help debugging, seek the help of the instructor or the TA.