CMSC 435/634: Introduction to Computer Graphics

Assignment 1

Simple Scene

Due September 12, 2012

The Assignment

Use Pixie (a free RenderMan compliant renderer) and C to model and render a realistic-looking room holding cell with an alien. The holding cell should be 10' x 12' with a ceiling 8' tall. The alien should be touching the floor of the room, and must be comprised of at least five body parts. Build your room and alien out of simple compositions of RenderMan primitives (RiPatch, RiCylinder, RiDisk, RiCone, RiTorus, RiHyperboloid, or RiParaboloid). You can find full docmentation for these in section 5 of the RenderMan specification. I'll show the best few in class, so be creative. The elements of the scene (walls, floor, ceiling, and alien) can be made of any "surface" material you choose, but should be made of different materials. You can find many surface options in the $PIXIEHOME/shaders directory, look for the surface ones (not light or volume).

Your scene should be illuminated by at least two specific lights, a light bulb using pointlight, and the sun, using distantlight. You can find the light options in the same directory as the surfaces, but look for the light ones. We want light/surface interaction, so don't use a constant surface or ambient light source. Select a viewpoint inside the room (or we will just see the outside of the walls), showing at least three room surfaces and the alien.


Incremental development will probably result in the most efficient use of your time. It is probably easiest to organize each object as a function in your program. For example, first write a function to draw the alien. Once that's working to your satisfaction, build the room, then position the alien inside of it. Now line up a good view and lighting. Initially use a simple primitives for placement, then add detail. 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).

Using Pixie

Read some tutorials available on the web on using Renderman and Pixie. You might try fundza (for various renderman topics) and Pixie Wiki (for a information on running the Pixie programs). You may also find chapters 1-3 of The Renderman Companion (in library or my office) and the Renderman Specification (linked off the course web page) to be useful. Pixie runs on a variety of platforms (including PCs running Linux, Windows, Mac OSX). Pixie is currently installed on gl, at /afs/

Before you start, you will need to get your own copy of the assignment files by following the class CVS directions.

Your development cycle will go something like this:

source /afs/
    (or pixie-bash for bash users)
    edit assn1.c 
    make assn1.tif
    display assn1.tif (from an X-terminal)
until done

The .tif files can be kind of big, so you will probablynot want to leave a bunch around. You can check your currrent disk quota to see how much space you have left with the "fs listquota" command.

Working at home

If possible, don't. We 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 assn1.tif", copy assn1.tif to your home machine and display it there. TIFF image viewers exist for every platform out there (even web-entabled cell phones!). An alternative is to use the convert program and a web browser:

    convert assn1.tif ~/../pub/www/assn1.jpg

Then reload in your favorite web browser.

Render at home

The Makefile provided operates in three steps. First, it compiles your .c into an executable program. 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 assn1.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.

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.

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, use the constant surface and give each piece a different color until you've got them behaving properly. Then you can change the colors to whatever you want.

Submitting your work

You will be using the university systems, and using CVS to submit all work in this course. It is not necessary to develop there (though if you don't, you'll need to download and install your own copy of all necessary tools), but you do need to submit there. Refer to the class CVS instructions for submission details, but you will need to first check out a copy of your CVS files from the class repository into your own directory. This will give you the sample files you need to start work on this assignment. Do all of your work in your checked out copy, then check in your submission by the deadline. DO NOT work directly in the repository, if you do, we may not be able to retrieve your assignment and your work may be lost!

Turn in this assignment electronically by checking it into your assn1 CVS directory by 11:59 PM on the day of the deadline. Include a readme.txt file telling us about your assignment. What help, if any, did you receive from books, web sites or people other than the instructor and TA? What are the important features of your alien? What did you do to make the scene look more realistic?

Also submit all source and data files we need to build and 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, but not any automatically generated files. This includes the object (.o), executable or RIB files, or on Windows any .ncb, .suo, .vcproj.*, and on mac, any .DS_Store files. 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. 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.

Remember: If you do not include the statement of help in a readme submitted with your assignment, the assigment will be returned ungraded!!! You will need follow the CVS instructions to cvs add this file for it to be included it in your submission. Since this is the first assignment, you may want to check out a second copy of your repositoryin a different directory after you submit to make sure your submission is complete.