CS 381 Fall 2012
Assignment 2
Assignment 2 is due at 5 p.m. Wednesday, September 19.
It is worth 20 points.
Procedures
E-mail
answers to the exercises below to
ggchappell@alaska.edu,
using the subject
“GA2”.
- Your answers should consist of the source code for Exercise A.
This should be attached to your e-mail message.
- Send only the above!
I do not want project files or executables.
I also do not want things I already have, like
glut.h.
- Be sure to include your name in your e-mail.
- I may not read your homework e-mail immediately.
If you wish to discuss the assignment (or anything else)
with me, send me a separate message with a different subject line.
Exercises (20 pts total)
Exercise A — Animation & Mouse Interaction
Purpose
In this exercise, you will write an OpenGL/GLUT program
that uses the mouse in some significant way.
It will also involve user-controlled acceleration/deceleration
of moving animated objects.
Instructions
Write an OpenGL program that meets the following requirements.
- The program must be in C or C++ and produce graphical output using OpenGL.
- The program must be GLUT-based, following the rules for callbacks discussed in class.
- The program must use the mouse in some significant, reasonable,
noticeable way.
- The program must involve objects that move,
at least one of which
accelerates and/or decelerates as determined by the user.
- The moving objects must be properly animated using double buffering.
- The user must be able to affect the acceleration
(for example, through keypresses or mouse input).
- Placement of objects must be done using the OpenGL model/view
transformation.
Notes
- Remember what “acceleration” is.
I do not mean simply that the user can change an object’s speed.
Rather, an object should smoothly change speed,
as with gravity, the thrust of a spaceship, etc.
- Standards for code are as for
the first assignment
(must compile, readable, following conventions,
avoid extra output,
clear how program is used, not buggy-looking, give credit, etc.).
- Submitted code may be demonstrated in class.