UW Graphics Group

CS 559: Computer Graphics
Fall 2001

CS 559 Home
Calendar Resources Assignments Projects 1 2 3  

Tools for programming projects

Computer graphics is not a spectator sport. To really learn the ideas, you have to try them out for yourself. Therefore, in CS559, we will make you write some pretty substantial programs.

Graphics programs are hard to write. In addition to all of the graphics content, you must also deal with issues of the graphics hardware, operating system, windowing system, and file formats. Generally, you use standard libraries to help you with this.

We will provide you with a set of tools sufficient for doing your assignments. While there are some ground rules, we are pretty flexible as to what you actually use to implement your assignments.

The main ground rule:

No matter what, your programs must compile and run on the machines in the graphics computing clusters (B240, 1351, 1355) in the CS building. If you don't like the compilers or tools installed on these machines, we're sorry. If you write your programs somewhere else, it is your responsibility to make sure your programs compile and run on these machines.

You must use the Microsoft compilers installed on these machines.

We will provide sufficient tools for you to complete your assignment. If you want to use other tools, we may let you. However, you must recieve written (email) permission from the instructor first - when the assignment is given out. If you choose to use software other than what we support, you're on your own. We won't be able to help you with software other than what's standard, and we aren't responsible if some other software messes you up.

The Hardware Facilities:

In the basement of the CS Building (room B240) are 30 new computers that are very well equipped for doing graphics programming (AMD Athlon 1.33Ghz processor, GeForce 3 graphics cards, nice monitors, ...).

On the first floor of CS, there are three rooms with Dell computers that are well-configured for the assignments in this class. The ones in room 1355 are best for this class (Pentium III/500 w/3DLabs Oxygen GMX1000 cards).

Students in graphics classes have priority on these machines. However, since 638 students require the machines in B240, they get priority over 559 students.

Some words about C++ (and other languages)

The tools we have chosen to provide for the class pretty much require you to program in C++. This is not intended to be a statement about the relative merits of the programming language. However, certain tools (graphics libraries, and user interface toolkits) are available under C++, and would have been difficult to provide otherwise. I have a hints page for getting started with C++, that might also be of use if you already know C++.

There is no intrinsic reason why Java could not be used for the programming assignments in this class. However, we are not able to provide all of the tools that you need (for example, a 3D graphics library). Our previous experiences with allowing students to do graphics assignments in Java have been failures. We will not try it again this year.

If you have not used C++ before (or don't have a lot of experience with it), this poses a challenge: you will need to learn C++ and the toolkits that we provide in addition to the material you need to learn for class. My suggestion:

  1. Buy a good book on C++.
  2. Start on your assignments early
  3. Avoid using fancy features of C++. The language has lots of advanced features that are difficult to use and understand, and probably aren't that helpful to you.
  4. Practice writing programs and using the debugger. Try out the debugger on programs that work so you can see how to trace through your code.

In future semesters, we may provide better support for programming languages other than C++. So if you are really adverse to learning it, you might consider waiting until the next time the course is offered.

Software Libraries

In order to complete the assignments in this class, you will need to use a user interface toolkit (to help you make windows and buttons and stuff), a 3D graphics toolkit (to draw things), and some basic imaging code (to read and write pictures).

We will not test you on details of the software libraries!

User Interface Toolkit: FLTK

For the user interface toolkit, we have chosen to support a library called FLTK. This library is freely and publicly available (see www.fltk.org), and is installed on the instructional computers for this class. We will provide some notes on how to get started with fltk, and the specific details of using it on the computers in the CS clusters.

We chose fltk because it is simple, easy to learn, integrates well with the other tools we will use, and well designed. Because the source code to the entire toolkit is available, you can look at it to see how it works. As an added bonus, programs written with fltk are portable to other computer running Linux or Unix.

In case you're wondering I use fltk for all of my research projects. Many commercial animation studios use fltk for their projects too.

A warning: the CSL has installed fltk version 1.0.11. This is NOT the most current version. The newer versions (especially version 1.1 and later) are incompatible. If you program somewhere other than the cluster, make sure that you get this older version of FlTk.

You may use something other than fltk. (the obvious choices are the standard Windows "MFC," native Win32 libraries, and other portable toolits such as Tcl/Tk). If you choose to do this, you'll be on your own: we will not help you with other toolkits. If you do choose to use another toolkit, make sure that it supports displaying images and having OpenGL windows. (MFC can do this, but its tricky.)

Note: while fltk is portable between UNIX and Windows, there is no guaruntee that your program is portable. If you write your program under Linux, make sure to test it under windows!

For your programs using OpenGL, you might consider using GLUT rather than fltk. If you chose to do this, you are on your own.

2D File Format Reader/Writer: libtarga

For assignments in this class, you will need to read and write images in a standard file format called "targa." You've probably encountered pictures stored this way before (they have .tga extensions).

Targa is a very simple format, and you could write your own reader and writer for it. However, we have created a library that reads and writes these files for you. The library was written by Alex Mohr, a student who works in the graphics group. While we make no guaruntees that it can handle absolutely every type of targa file, we do promise that we will not test your programs with images that do not work on it. Send questions about libtarga to the TA, not to Alex!

The targa library is available here, and an example program is available here.

General Purpose Graphics Library: OpenGL

For much of this class, you will use a graphics library called OpenGL for your graphics. OpenGL is an industry standard that is becoming increasingly popular. It is a standard part of Windows.

A good place to get started with OpenGL is my OpenGL Survival Kit, which discusses how to get your program to compile, and how to use OpenGL with FlTk.

While documentation for OpenGL is part of Windows, and there are lots of examples on the web, we require you to buy a copy of the OpenGL Programmer's guide. (it is a required text for the class). Not only is this a good source of information about OpenGL, but it has good discussions about many of the important topics in graphics, and makes a great supplement to the textbook.

UW Graphics Group

CS559 Web

Home Resources Assignments Tools  
Calendar Policies Projects 1 2 3   Examples
Copyright (C) 2001 by Michael Gleicher
Last modified: 19:10 Nov 15, 2001