CS 248: Introduction to Computer Graphics

Pat Hanrahan


Assignment 2 Getting Started

Read the Assignment 2 handout before this.

Then go to your local directory where you want to develop your code in (i.e., ~/cs248/assignment2). Decide what platform you want to develop in: C or C++. If you want to get the very best performance, we suggest you use C, although C++ can be as fast provided that it looks like C in the inner loops.

If you want to use C, type:
cp /usr/class/cs248/assignments/assignment2/template/Makefile_c Makefile
ln -s /usr/class/cs248/assignments/assignment2/template/cube.h .
ln -s /usr/class/cs248/assignments/assignment2/template/render.h .
ln -s /usr/class/cs248/assignments/assignment2/template/cube.c .
ln -s /usr/class/cs248/assignments/assignment2/template/geometry.c .
ln -s /usr/class/cs248/assignments/assignment2/template/main.c .
cp    /usr/class/cs248/assignments/assignment2/template/rasterize.c .
ln -s /usr/class/cs248/assignments/assignment2/maps .

If you want to use C++, type:
cp /usr/class/cs248/assignments/assignment2/template/Makefile_cc Makefile
ln -s /usr/class/cs248/assignments/assignment2/template/cube.h .
ln -s /usr/class/cs248/assignments/assignment2/template/render.h .
ln -s /usr/class/cs248/assignments/assignment2/template/cube.cc .
ln -s /usr/class/cs248/assignments/assignment2/template/geometry.cc .
ln -s /usr/class/cs248/assignments/assignment2/template/main.cc .
cp    /usr/class/cs248/assignments/assignment2/template/rasterize.cc .
ln -s /usr/class/cs248/assignments/assignment2/maps .

Remember that the only file you will be touching is rasterize.c / rasterize.cc. This is the only one you will be turning in. All the other files are links to the class files. This will allow us to fix bugs and add features found in the other source files without you having to copy them every time. If you feel a strong desire to have your own copy of the files, just make the "ln -s"'s into "cp"'s. We will keep you up to date on source code changes on the class Web page for Assignment 2 Announcements.

BTW, in order to get your file dependencies done automatically, type:
make depend

In order to get rid of all the cruddy files, type:

make clean

In order to get rid of all but the source files, type:

make spotless

If you want to see our sample viewer, type:

/usr/class/cs248/assignments/assignment2/sample_viewer

The sample environment maps being linked to your local directory are in:

/usr/class/cs248/assignments/assignment2/maps

A sample rasfile is:

/usr/class/cs248/assignments/assignment2/pair.ras

Remember to get documentation on the viewer by typing:

/usr/class/cs248/assignments/assignment2/sample_viewer -h

hanrahan@cs.stanford.edu

Copyright © 1996 Pat Hanrahan