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.
(10) render at least one other structure (like another barn or a house) from scratch using a procedural wireframe model (as discussed in class). Note that you will have to compute the normals to the surfaces in order to get the lighting correctly for it (see p. 52-58 of the openGL Programming Guide for how to do this).
(8) Implement the arrow keys to allow the viewer to move around and view the scene from various viewpoints.
(5) Add realistic animated objects (planes, cars, cows) [For this, you must provide a key to turn animation on and off].
(3) Add a transparent surface (like one of the barn walls). You will receive points only if there are no visible artifacts. Hint: You'll have render your objects in a particular order depending upon the viewpoint
(2) Add texture mapping to two surfaces, with different texture maps for each.
(3) Add shading controls. Use controls to allow the user to select between Flat or Gouraud shading.
(3) Add a curved surface, other than a sphere, cylinder, cone, etc. You can add it as a mountain, or a hippie sweat-lodge in flattened-dome-shape.
(3) An animated texture (e.g. a slide show on a wall)
(3) Add a mirror. Hint: Reflect the world about the mirror and render it again through a stencil buffer.
(3) Add shadows on at least one surface (such as the floor or table). Hint: See the OpenGL Programming Guide for the transformation which renders objects onto a plane.
(3) An alternate viewing scheme in which the camera moves around the exterior of the scene, looking into the scene from above. A keyboard control should be added to toggle between interior and exterior viewing schemes, and mouse controls should be added to provide a "crystal ball' style interface for the exterior viewing scheme. See the FAQ below for a description of this
(3) Full scene anti-aliasing using the accumulation buffer. Hint: See the OpenGL Programming Guide for information about jittering
(3) Include particle effects (e.g. steam from a teapot). Hint: Maybe try rendering randomly moving, small triangles with a texture map of a dot on them... Make sure the effect is convincing.
(?) Impress us with something we hadn't considered...
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.
More hints on the way.
Check for announcements on the newsgroup, su.class.cs148
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.