Homework 1

22C:151 Introduction to Computer Graphics
Due Tuesday, September 2, 2003

1. (3 points) Tell me why took this course (do you expect it to be useful in your future work, etc.) and what topics in computer graphics interest you.

2. (2 points) Give me the URL of a WWW site that you thing has interesting stuff relevant to computer graphics (could be a computer art site, game programming site, graphics research site, etc.)

3. (10 points) Write an OpenGL program that pops up a window and draws a few filled 2D shapes (triangles, general polygons, etc.) in it. Submit your program according to the guidelines on the class WWW home page. For the on-line part of the submission, respond 'hw1' to the ``Location:'' request.

In this exercise you're not expected to draw something especially interesting. The point is simply to make sure that you can log on to a machine and get some graphics code running. Depending on your familiarity with Unix, C/C++, graphics programming, libraries, and makefiles, this is either a trivial or a pretty difficult assignment. I'm intentionally not giving a lot of help on this assignment, so that you are forced to figure out how to deal with libraries, compilation, etc.

To see what your program should do, try the sample executable files:




Note on 'gmake' and makefiles

For this course, you will need to know how to use 'gmake' and makefiles. 'gmake' is a GNU Unix utility that helps you compile and link programs composed of multiple source files. The course WWW page has a link to a good source of information on makefiles. On the CS dept Linux machines, the "make" command is the same as "gmake", you can simply type "make" instead of "gmake" wherever "gmake" occurs in my examples.

In previous semesters, the following general makefile was a good template for all the homeworks for this course and for Linux, HP, and SGI platforms. sample hw1 makefile. However, at present this general makefile does not work on CS Linux machines (even though it probably should!).

Instead, use temporary hw1 Linux Makefile for now. To make it work, you will also need to set an environment variable by typing, to your shell:

    setenv LD_LIBRARY_PATH /group/class/c151/lib:$LD_LIBRARY_PATH
You'll have to do this each time you open a new shell unless you put a similar line in your .cshrc file (or put
    export LD_LIBRARY_PATH=$GLUT_HOME/lib/glut/:$LD_LIBRARY_PATH
in a .profile file.)
To create the hw1 executable on Linux, simply do
 
    gmake -f temp-linux-makefile hw1    (on Linux)

To use the more general makefile, when/if things are working properly, do, e.g.
    gmake -f example-general-makefile OS=HPUX hw1     (on HP)
    gmake -f example-general-makefile OS=LINUX hw1  (on Linux)