CMSC 435/634: Introduction to Computer Graphics

Assignment 1

Simple Scene

Due September 16, 2004

Last updates:
Tue Sep 14 17:39:31 EDT 2004

The Assignment

Use 3Delight (a free RenderMan compliant renderer) to model and render at least two different desserts on a tabletop. The table should be 40"x56" and 30" high. You may choose to place any desserts you like on the table, but it is best to choose ones that can be made by simple compositions of RenderMan primitives (e.g. RiCylinder, RiDisk, RiCone, RiSphere, ...). Examples could include a pie or slice of pie, a cake or slice of cake, an ice cream cone or a bowl of ice cream. Desserts should be modeled at their natural sizes, and should be sitting on (touching) the table top. The elements of the scene can be made of any material you choose, but should be made of different materials. Make them as realistic as possible. Your scene should be illuminated by at least two specific lights (i.e. don't use a constant surface or ambient light source). Select a viewpoint that shows the scene from an oblique angle (i.e. not aligned with any of the coordinate axes), and allows us to see all three elements: table including at least one visible leg, and both desserts.

Using 3Delight

Read RenderMan for Poets (for a very brief introduction to RenderMan) and 3Delight User's Manual (for a information on running the 3Delight programs). You may also find chapters 1-3 of The RenderMan Companion (on reserve in the library) and the RenderMan Specification (linked off the course web page) to be useful. 3Delight runs on a variety of platforms (including PCs running Linux, Windows, Mac OS X). 3Delight for Linux is currently installed on, rooted at ~olano/public/435/3delight. To set up 3Delight for use, csh or tcsh users must
unsetenv DELIGHT
source ~olano/public/435/3delight/.3delight_csh (ignore ldconfig messages if you see them)

bash or sh users would instead use

. ~olano/public/435/3delight/.3delight_bash

Your development cycle will go something like this:

    edit desserts.c 
    make desserts.tif (you'll find a sample Makefile in ~olano/public/435/assn1)
    display desserts.tif (full path == /usr/local/bin/display)
until done


Incremental development will probably result in the most efficient use of your time. For example, first try to get your program to draw a single flat square for the table. Once that's working to your satisfaction, construct and position the legs for the table. Similarly, model each dessert in isolation. When all elements are working, position them in an appealing scene. Once you've got the basic setup, keep refining to make it more realistic until you're satisfied or you run out of time (whichever comes first).

We are using CVS to submit assignments, but it is really a revision control system. Use it! Check in to CVS often. If you break something or accidentally lose files, you can always go back to a previous revision.

Some debugging tips

  1. If your image is blank, check the camera position and direction. It may be pointing away from your scene.
  2. If some primitives are missing, check their orientation. Most primitives are transparent when viewed from behind.
  3. If some primitives are still missing, check the lighting. Surfaces on which no light falls will be black, just like the default background.
  4. If you're having trouble keeping everything straight, give each piece a different color until you've got them behaving properly. Then you can change the colors to whatever you want.

What to turn in

Turn in this assignment electronically by checking it into your Assn1 CVS directory by 11:59 PM on the day of the deadline. We will use a dated checkout for grading, so you will be graded on whatever has been checked in as of 11:59 PM.Submit a readme.txt file telling us about your assignment. What (if any) help did you receive from books, web sites or people other than the instructor and TA? What are your desserts supposed to be? What did you do to make it look more realistic?

Also submit everything we need to run your submission. We should be able to run 'make' in your submission directory on the systems to produce a TIFF image for your project. Submit your modified Makefile, any C/C++ files, and any other auxiliary files we might need. Be sure to comment your code! You will not be graded on the presence or quality of your comments, but we will look at your code and anything that helps us understand what you did (or were trying to do) can only help. In any case, your programs are expected to be robust and easy to understand.

Working at home

If possible, don't. I test things out on the university computers and may or may not be able to help you if things don't work right for you at home. If you do work at home, your final submitted version must be able to run on the gl machines and must be electronically submitted there.

If you absolutely must work at home, here are some things you may try:

Image display at home
Instead of "display dessert.tif", copy dessert.tif to your home machine and display it there. TIFF image viewers exist for every platform out there (even PalmOS!). If you cannot find a working TIFF viewer, you can convert to another format on the gl machines:
    convert dessert.tif dessert.jpg
will convert from TIFF to JPEG. Convert keys off of the file extension and understands a huge number of image file formats. Two suggestions for free viewers that run on many platforms (including Windows and Linux) are GIMP (from and ImageMagick display (from GIMP is a full-featured image editor (and a great program) that happens to also be able to read and write many image formats. ImageMagick is a set of simpler tools for image display and conversion (including the convert program mentioned above).
Render at home
The Makefile provided operates in three steps. First, it compiles your .c into an executable program, table. Then it runs that to get a RIB format description of the scene. Finally, it renders the RIB to get the TIFF. If you have a RenderMan renderer at home run
    make dessert.rib
on the gl machines, transfer the resulting RIB file to your home computer, to render there. RIB files are plain text, so transfer quite reliably.

I cannot help you debug your home RenderMan installation. Many RenderMan renderers are listed on the Dot C Software pages. Builds of 3Delight are available for Linux, Windows, Mac OS X, and IRIX.

Compile at home
The Makefile I provided may not help you here, except for general guidance. Simple RenderMan C files should be quite portable, but allow some time to back-port before submission if you have any #includes beyond ri.h. You will need to figure out from your RenderMan documentation how to compile a RenderMan C program to either produce RIB or render directly.