Comp 360 Lab0 : Learning OpenGL

Fall 2008

Overview

The purpose of this lab is to familiarize you with the code framework we provide, as well as with basic OpenGL drawing commands. You will implement a program that mimics an old screen saver by filling the screen with random two-dimensional geometry.

This project is due at 11:59 PM on Monday, September 1st. Because this is a ``practice" lab, it is worth 0 points; however, if you do not complete this lab on time, we will subtract 100 points from your final lab grade.

Specification

The program will start out with a blank screen. The user interacts with the program by pressing keys to change the behavior of the program.

The program has four modes: idle, points, lines, and triangles. The behavior in each mode is as follows:

Except during idle mode, new shapes should be added to the screen on each frame. That is, every time the renderFunc() is called, your program should add another point, line, or triangle to the visible image. After enough shapes have been drawn to fill the window, the screen should be cleared; drawing should continue. The screen should also be cleared whenever the mode is changed.

The program should terminate when the `Esc' key is pressed.

Click here for an example of this program. Your program does not need to match the example exactly, but it should meet the criteria listed above.

Hints

Remember that the framework we provide clears the screen between each call to renderFunc(). Therefore you have to draw all the geometry you want to display each time this function is called- the screen will not remember what you have previously drawn. You might store previously generated vertices in a list so they can all be drawn for each frame.

To get random numbers, you can call the C library function rand(), which returns an integer between 0 and RAND_MAX.

What To Turn In

Create the directory comp360/lab0 in your home directory. This directory should contain your source code and all files needed to build your program in Visual Studio. Also include a README file with your name, your Owlnet username, and any implementation details you think your grader should know.

When you are finished with the project, please send an email to powei.feng@rice.edu.

Back to Home page.





Powei Feng 2008-08-26