CAP4730: Assignment 1
Getting up to speed with C/C++ and OpenGL
Assigned: Monday, January
9th, 2006
Due: Monday, January 30th, 2006
- Get a "skeleton"
program to compile and execute on your platform of choice.
- Use OpenGL to draw discs and
move them about.
From the class webpage, download assignment1.zip.
Make a directory and move assignment1.zip into it. It should unzip
into the appropriate directories, along with any needed .lib files.
What is given to you:
project1.cpp - a skeleton OpenGL/GLUT program that can be
thought of as a framework for your work. It provides a rendering
window, framebuffer, and callbacks for keyboard and
mouse actions.
project1.h - header file that containts data
structures for main.cpp
glut.h, glut32.lib, glut32.dll - Windows library that
needs to be linked in (for UNIX guys, link in -lglut)
project1.dsw - project's Visual C++ 6.0/.net workspace.
- Compile assignment #1 and
make sure it works
- It should draw one disc in
the center of the screen
To do:
- Draw a rectangle
- Have the disc move about
within the rectangle and bouncing off the sides of the rectangle.
- The user should control the
sides of the rectangle with the following:
- ‘a’ and ‘s’
moves the left side of the rectangle left and right, respectively
- ‘d’ and ‘f’
moves the right side of the rectangle left and right, respectively
- ‘q’ and ‘z’
moves the top side of the rectangle up and down, respectively
- ‘w’ and ‘x’
moves the bottom side of the rectangle up and down, respectively
- Don’t worry
about handling special cases such as if the top and bottom switch sides,
etc.
- The disc should bounce off
the sides of the rectangle appropriately.
- The user can double the
number of discs with the ‘+’ and cut the number of discs in
half with the ‘-‘. Your
program should handle drawing at least 8192 discs.
- Calculate and display (in the
upper left-hand corner) in real-time your program's frame rate (up to
tenths of a frame, e.g. 27.5 fps).
Quality (Choose 1. Here are some EXAMPLES. You can CHOOSE TO DO YOUR OWN):
- Make a game
- Allow for screenshots
- Put in a particle system
- Inter-disc collisions
Report (1 page):
- Write
1 paragraph on what you implemented, and 1
paragraph on how you moved the discs about.
- Answer
the following questions with at most 2 sentences each:
- 1a. What factors impact program speed?
- 1b.
How many discs does it take for your machine to run at 5 fps?
- 2.
Create a graph of your program's performance (x axis - number of discs, y
axis - frame rate)
Turn in:
·
makefile,
.sln/project, .cpp, .h –
what we need to compile your project. If you think any additions you
might have made would cause problems, please verify w/ your TA.
·
.doc or .pdf of your
report
·
Please head to www.cise.ufl.edu/~lok/teaching/csgss06/turnin.html
for the latest info
Grading:
100 pts (15% of total grade)
If you get it right: 70 points
·
30 points - disc movement
·
20 points - keyboard input
·
10 points - fps
·
10 points - disc increase/decrease
Quality: 20 points
Documentation: 10 points