CMSC 435/634: Introduction to Computer Graphics

Assignment 1

Simple Scene

Due September 14, 2011

The Assignment

Use Pixie (a free RenderMan compliant renderer) and C to model and render a realistic-looking plate of cookies on a table. The table should be 36"x48" and 30" high. Your scene must include at least three types of cookies. You can choose any kind of cookie you want, but it is best to choose ones that can be made by simple compositions of RenderMan primitives (RiPatch, RiCylinder, RiDisk, RiCone, RiTorus, RiHyperboloid, or RiParaboloid). I'll show the best few in class, so be creative. The plate should be sitting on (touching) the table, and the cookies should be sitting on the plate or each other. All objects shold be modeled at their natural sizes. The elements of the scene 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 (i.e. something like pointlight or 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 that shows the table from an oblique angle (i.e. not aligned with any of the coordinate axes), and allows us to see all the elements. The table need not be completely visible, but we should be able to see at least one leg, as well as the plate and cookies.

Strategy

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 a single flat circle for the plate. Once that's working to your satisfaction, build the table and position the plate on top of it. Now line up a good view and lighting. Then add the cookies one by one, initially just as a simple primitive for placement, then adding 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/umbc.edu/users/r/h/rheingan/pub/435/pixie-2.2.4

Your development cycle will go something like this:

source /afs/umbc.edu/users/r/h/rheingan/pub/435/pixie-csh
    (or pixie-bash for bash users)
repeat
    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.

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.

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 userpages.umbc.edu/~YourUserName/assn1.jpg in your favorite web browser.

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 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.

Submitting your work

You will be using the university linux.gl 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 and labelling this version with the "submit" tag 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 your cookies supposed to be? What did you do to make it 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 linux.gl 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.