CS 148 Assignment 3

Intro to openGL

Due: July 28


Goals

This assignment serves as an intoduction to the OpenGL graphics library.  You are required to generate a barn yard scene which can be navigated in a walk-through fashion.  Emphasis is placed both upon the implemention of OpenGL's basic capabilities (e.g. shading. lighting, transparency, materials properties, etc.) and their use in generating more involved effects (e.g. shadows, reflections.) Note that you have a lot of  freedom in terms of how you create the scene, but keep in mind the basic capabilities that we ask for (see below) so that your scene is too complex.

Specifications

a) Create a 3-D scene consisting of a barn (rectangular box), a silo (a circular cylinder with a cone on top), some trees, and a bunch of stars.  The barn, trees and silo should be on the ground, i.e., there should be a well-defined ground object which defines the horizon in your scene. The horizon separates the ground from the sky.   You may use any OpenGL primitives.

These are the basics. The entire assignment is worth 50 points, with possible extra credit. Rendering the scene as described above  is worth 10 points. The following is a list of features that you may implement. The number in parentheses corresponds to how many points it is worth.  Options in bold are mandatory.

Getting Started

You could use the code available in the openGL Programming guide, or some of the programs we discussed in class to start on this project. You can use the same Makefiles we were using before (if you're confused about which one, you can always download the one in http://www.stanford.edu/class/cs148/code either Makefile.linux or Makefile.sun would work). You have to remember to add to the SRC variable  any new files that you want to compile.

We highly recommend that you plan in advance towards the addition of new features. This does not mean tackling everything at once. Rather, you should decompose things well so that adding features could easily fit into new functions with just a new call. Basically, don't put everything in three functions. This will make it horrible for you to debug.

What to Submit

You should submit:

Hints

FAQ

What it a 'crystal ball' style interface?

When the user holds the left button, moving the mouse left and right should rotate the world left and right about the world's origin, and moving up and down should rotate the world up and down about its origin.  If the user hold the middle button, then moving the mouse up and down should zoom toward and away from the origin.  Some implementions also provide the ability to hold both buttons to cause mouse motion to translate the world in a plane parallel to the viewport. This should alter the origin for the previously mentioned rotations, so you might add a control to reset the origin should the user end up in a strange state.