The Scene

CS426 Assignment 2

Assigned Oct. 5, 1998, due Thursday Oct. 15, 1998, 11:59pm


In this assignment you will model and render a scene using OpenGL.


You have a choice of what to model. This can either be:

The room has to have walls, a floor and a ceiling. Backface culling should be enabled such that you can look in the room when outside, and not look out when inside.

A minimum amount of furniture is also required: a table, four chairs, and a desk/counter/cabinet, with a desk lamp on it.

The tabletop is transparent.

The desk lamp has to be of the "Luxo Jr." type, a crude approximation of which you see here to the right.

The user should be able to choose between Flat or Gouraud shading of the scene.

Finally, implement a simple walkthrough interface using the arrow keys (e.g. <- is turn left, -> is turn right, up and down keys move forward and backward).

Getting started

Read chapter 1 of the OpenGL Programming Guide to get you started. You can find the source of all the examples in the book in /u/cs426/OpenGL/book.

Most books are also available online: run /usr/sbin/insight to see all the books, or /usr/sbin/insight -v OpenGL_PG for just the OpenGL Programming Guide.

Also, in /u/cs426/OpenGL you will find three very small example programs. Two were written using the so-called auxiliary library. The successor to this library is called the Graphics Library Utility Toolkit (GLUT). The third example uses the GLUT, which we recommend. Click here for a PostScript version of the documentation.

Finally, you may want to read chapters 4 and 8 of the course book.

Extra credit

If you implement the required features, you score 10 out of 15 points. In practice this can be more or less than 10 depending on how well you implemented them. We will be looking at both the aesthetic quality and coding efficiency of your scene design.

Fortunately, there are lots of opportunities for extra credit. Below is a table describing the options, with an indication of the number of points each is worth.

Obviously there are many more extensions possible. Come to us if you have thought of this cool object that you want to model and want to know if it's worth modelling...

The winning letter "O" for the art contest1 point
More than one transparent object1 point
Lighting1 point
Curved surfaces other than sphere/cone/cylinder1 points
Bookcase with randomly generated books. Get more points if they are tilted and not intersecting2 points
Shelves with randomly generated items such as pots and pans2 points
Animated things (e.g. rotating fan on the ceiling)2 points
Great looking textures2 points
Ability to move parts of the desklight2 points
Same, with the other parts moving correctly based on a physical model3 points
A mirror3 points
Steam rising out of a coffee cup3 points
Generate a fractal landscape visible through a window4 points


Type /usr/demos/General_Demos/mirrors/RUN (it could be that this demo is not installed on your system) to see a demo of a room with some animated stuff in it. It's pretty ugly, but shows off some cool effects.

CS426, CS Department, Princeton University
Last modified: Sun Oct 11 15:12:19 EDT 1998