Assignment 1

Goal: To familiarize yourself with the basics of OpenGL and GLUT by creating a simple OpenGL application.

Due Date: January 18, 2007

Steps

  1. Download the skeleton code and setup GLUT with your development environment to get the code to compile and run. The GLUT HOWTO explains how to do this if you aren't familiar with setting up and using libraries with your development environment.

  2. Read up on OpenGL and GLUT and answer the following questions. Be sure you can answer all these questions before moving on.
    1. In a GLUT program, how is control passed back to the programmer? How is this set up during initialization?
    2. What does the parameter to glutInitDisplayMode() in main() specify?
    3. What do the calls to glOrtho() and glViewport() in the reshape() function accomplish? If the window is to be resized, why might we want to change this?
  3. Add to the program to draw something (anything!). Your completed program should at a minimum:
    • Draw using at least two primitives (e.g. lines and triangles)
    • Draw using multiple colors
    • Use some user input to do something in the program. This could be as simple as using the number keys to select one of multiple modes.
  4. Write up and submit your program. Your write up should contain both the answers to the questions and any notes we should know about running your program.

Skeleton Code
The skeleton code contains a very simple GLUT based OpenGL program. All it does is create a window and draw a blank screen. We are providing the code packaged for various platforms/IDEs.

Just the code

main.cpp

Code + Visual Studio Project

assignment1_vs.zip

Code + XCode Project

assignment1_xcode.zip

Code + Cross Platform Makefile (Linux, MacOS X)

assignment1_unix.tar.gz

Resources

Inspiration for What to Draw
You may draw anything interesting, but here are some ideas to get you started.

Grading Scale Grading for this and all future assignments is based on a four star scale. On this assignment you can receive:

How to submit

last edited 2007-01-18 01:40:37 by nymphomaniac