CMSC 435/634: Introduction to Computer Graphics

Assignment 1

Simple Scene

Due February 12, 2002

The Assignment

Use 3Delight (a free Renderman compliant renderer) to model and render a bowl full of marbles on a tabletop. The table should be square, 36"x36". You needn't show the table legs. The bowl can be any size or shape you want, but should be sitting on the table top. The marbles should be sizes ranging from 0.5" to 1.5" in diameter. The table, bowl and marbles 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 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 (ie. not aligned with any of the coordinate axes), and allows us to see all three elements: table, bowl and marbles.

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 linux.gl, rooted at ~olano/public/435/3delight.

Your development cycle will go something like this:

unsetenv DELIGHT
source ~olano/public/435/3delight/.3delight_csh (ignore ldconfig messages if you see them)
repeat
    edit marbles.c 
    make marbles.tif (you'll find a sample Makefile in ~olano/public/435/assn1)
    display marbles.tif (full path == /usr/local/bin/display)
until done

Strategy

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, choose a shape for the bowl and position it on top of the table. When both table and bowl are working, add the marbles. 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).

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 (the order in which you have specified the vertices). Polygons 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 as 'cs435 Proj1' using the submit mechanism:
    submit cs435 Proj1 [files...]
Submit a RIB file, the C program which generates it, and the image it creates. If you modified the Makefile, submit that as well (however, we must be able to run your submission on the gl systems to grade it). Your comments should include information about which computer platform (HW and OS) you developed your program on. Additional comments may help your grade in cases where your program does not operate entirely correctly (since they can give me insight into what you were trying to do). 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 marbles.tif", copy marbles.tif to your home machine and display it there. TIFF image viewers exist for every platform out there (even windows). If you cannot find a working TIFF viewer, you can convert to another format on the gl machines:
    convert marbles.tif marbles.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 www.gimp.org) and ImageMagick display (from www.imagemagick.org). 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 marbles.c into an executable program, table. Then it runs table to get a RIB format description of the scene. Finally, it renders the RIB to get table.tif. If you have a RenderMan renderer at home that accepts RIB files (all that I know of do), run
    make table.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 find a working RenderMan renderer for home. If you run Linux or IRIX you may copy the version of BMRT on the gl machines. Otherwise, you may want to check the Dot C Software pages.

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.