Interactive Graphics

Tuesday and Thursday 3:30pm-4:45pm

719 Broadway, room 1221.

Denis Zorin, office hours: Thursday 5-6 pm and by appointment

Description

This course is an introduction to interactive computer graphics techniques, with primary focus on techniques used in computer games. Topics covered (time permitting) will include 2d interactive techniques, sound, 3d graphics basics, game physics, and AI for games.

Prerequisites

All programming assignments must be implemented in C or C++, with a strong preference for C++. Some familiarity with basic linear algebra (vector operations, matrices) will be assumed.

Requirements

Assignments. There will be four programming assignments. These will count for 80% of the grade.

Midterm and final. There will be no midterm; the midterm grade will be determined based on assignments. There will be a written final, primarily focused on geometric foundations of 2d and 3d graphics techniques.

Reading materials

There is no textbook. All necessary course materials will be posted on this page.

Software

We will use mostly cross-platform tools. You can use either Windows or Linux, but please avoid introducing operating system dependencies into your code. The focus of this class is on fundamental principles and techniques; thus we will use the simplest available APIs, to minimize the time you need to spend learning API details.

Compilers. Linux users are likely to have gcc installed; if you need help with installation please contact the instructor. For Windows machines you can either use gcc with cygwin, or Micorsoft Visual Studio. If you do not own a copy, you may be able to get one for free through MSDNAA Please send me a message if you want one.

OpenGL. All graphics programming will be done in OpenGL. It is a standard part of any recent Microsoft OS; a package may need to be installed for Linux. Kavin Cox provided instructions for Mac. If you need help with this please contact the instructor. The Web site www.opengl.org contains many useful links and references.

GLUT. OpenGL provides functions for drawing 2D and 3D objects, but no support for window operations and user input. GLUT is a simple cross-platform package that adds functions for opening windows and processing keyboard and mouse input. Detailed information and downloads can be found on the GLUT Web page

GLUI. Neither OpenGL nor GLUT provide support for standard GUI elements (buttons, sliders etc) GLUI is a cross-platform C++ library that provides such functionality. All GUI objects are implemented using OpenGL, and can be easily integrated with 2D and 3D graphics.

ImageMagick is a comprehensive image manipulation library. We will use it primarily to be able to load images into our programs to be used as sprites or textures. It can be downloaded from www.imagemagick.org. When installing windows binaries, make sure you choose the option to install the headers and libraries.

OpenAL is is a cross-platform 3D audio API appropriate for use with interactive applications. It provides basic tools for 3D sound. The documentation for OpenAL can be found at www.openal.org. The SDK for Windows and MacOS X can be downloaded from Creative Labs developer site. Linux binary packages are also available for various distributions of Linux.

Assignments

Late policy: No extensions will be given on the day the assignment is due, all extensions (excluding emergencies) should be requested at least 3 days in advance. The penalty for assignments up to 2 days late is 10%; up to a week late, 20%; up to two weeks late, 40%; no points will be given for assignments submitted more than two weeks late.

Assignment 0. Due: January 24.
1. Install (if necessary) OpenGL and GLUT on your computer. Make sure you can compile template.cpp
You do not have to submit anything for this part.
2. Write a detailed plan for a 2D game you are going to implement. Please follow (to the extent it is possible for the game you describe) the plan for Pong. You may want to take a look at variants of some classic games; a few can be found on the web (ask me for links if you cannot find any).

Assignment 1.Implement the game described in your plan. Please submit your homework by sending e-mail to dzorin@mrl.nyu.edu.

Assignment 2. Due: March 9.
Images, sounds and 2.5D. Add images and sounds to your game; make it 2.5-dimensional as discussed in class. You should have at least 3 different images used for objects in your game, at least one including transparency, and 3 sound sources, at least one moving. The code should use OpenAL for audio. Thecode should support a general overall view of the game, with user being able to change viewing position arbitrarily, using one of the interacting viewing interfaces discussed in class, as well as a view from the point of view of one of the moving objects in the game.

Final assignment Due: May 4 4pm
Write a three-dimensional game The game should include the following elements:

Please submit the code for the game and prepare a demo + brief presentation explaining how everything was implemented (10-15 min). We will meet for the final time from 4 to 6 pm on May 4.

Lectures

January 17Introduction and history of computer games.
January 19 GLUT and OpenGL intro.
January 24 Vector math basics.
January 26 Implementing a bouncing ball.
Code for lectures 2 and 4.
cvec2t.h
cvec3t.h
template.cpp
January 30 Transformations and transformation hierarchies.
Bouncing ball code finished: template.cpp Transformation slides.
February 2 Textures, introduction.
Code: images.cpp tga.h tga.cpp
February 7 Textures: mipmapping.
February 9 Textures, continued.
Code:
images.cpp
vinni-eyes-1.tga
vinni-eyes-2.tga
vinni-eyes-3.tga
February 14 Viewing
February 16 Viewing, continued.
Source code for the viewing example.
February 21 Sound, OpenAL introduction
Sample OpenAL code
Sound files: mono.wav stereo.wav ding.wav Footsteps.wav wave1.wav wave2.wav wave3.wav wave4.wav
February 23
Ken Perlin's lecture.
February 28
Three-dimensionalizing pong. Source code. Pong with sound. Source code.
March 2 Pysics intro: particles.
Physics references:
Several inroductory articles and a bibliography by Chris Heckler.
SIGGRAPH course notes by A. Witkin and D. Baraff, more advanced.
MyphysicslabA collection of Java applets with detailed explanations by Eric Neumann.
A particle system API by David McAllister with good examples.
March 7 Particle systems. (Yotam Gingold)
March 9 Cancelled.
March 14 spring break.
March 16 spring break.
March 21 Physics: rigid objects in 2D.
Code: physics2d.cpp
March 22 Physics: rigid objects in 3D.
Code:
physics3d.cpp
hmatrix.h
cvec4t.h.
March 28 Physics: deformable objects, mass-spring systems.

March 30 Meshes. slides
Mesh libraries: CGAL, OpenMesh, GTS, David Gu's library.
April 4 Proposal discussion.
April 6 Zip archive with source code for mdlviewlib library (extracted from Half-Life SDK).
Zip archive with sample code using mdlviewlib; includes the library compiled for Windows.
A document from Half-Life SDK with file format descriptions etc. (mostly about how to use 3D Studio Max, but Mikshape3D also works and is much more affordable).
Milkshape3D Web site.
How to make an mdl modela step-by-step explanation. A dummy texture in correct format.
Complete Half-life SDK
April 11 Half-life models continued. How to build models in Milkshape.
April 13 Path finding. A-star algorithm. A tutorial including many links.

Denis Zorin