CS 248: Introduction to Computer Graphics

Pat Hanrahan


Assignment 1 Support Code

The support code for assignment 1 is now accessible. It is located in the following directory:

/usr/class/cs248/assignments/assignment1 Please DO NOT copy all the code in this directory to your own directory. Instead do the following:

  1. Set up your own directory for assignment 1 and go into it.
  2. From there link to the Makefile with the following command:

    ln -s /usr/class/cs248/assignments/assignment1/Makefile .

  3. Copy the imgpaint.c into your directory:

    cp /usr/class/cs248/assignments/assignment1/imgpaint.c .

imgpaint.c is a template program that can load, clear and save PPM images. This is the file you will modify and add code to for this project. These are all the files you need to compile imgpaint.c. To compile imgpaint in your directory simply type:

make imgpaint The files imagefuncs.o and imagefuncs.h contain the Image datatype that we have defined for you as well as functions that read and write PPM images. You should look at these files (especially imagefuncs.h) but there is no need to copy them or modify them.

Once you have compiled imgpaint try running it on a ppm image. We have set up a library of such images in: /usr/class/cs248/images

Copy an image into your working directory and type:

imgpaint imagename For example:

imgpaint motorcycle.ppm Feel free to find and use your own ppm image files as well.

People who are working on offsite machines (i.e. not in the Graphics Lab at Sweet Hall) will probably have do to a little more work to get this stuff working properly. You will have to copy all the files in the support directory and change the makefile for your particular setup.

[email protected]

Copyright © 1997 Pat Hanrahan