Introduction to Computer Graphics
CSE 470
Arizona State University

Instructor: Gerald Farin
Teaching Assistant: Robby Walker

Spring Semester 2005

 
 

Project 3: surface of revolution 3d viewer

due 4/6/05

 

         

Purpose
This project has been designed for you to get experience with the following basic computer graphics concepts.
  • Generating 3D geometry: a surface of revolution
  • Creating a triangulation data structure
  • Creating face and vertex normals
  • Setting up the lighting model
  • Flat and smooth shading
  • Specifying the light's position
  • Accepting mouse window coordinates and converting them to world coordinates
Overview

You will develop an application that allows the user to create a surface of revolution and interactively view it with lighting and shading options.

The user will input a closed polygon by choosing vertices in the window with the mouse. Next, Chaikin's algorithm will be used to smooth or subdivide the input polygon, creating more vertices which form a "curve". This curve will serve as the generating curve for a (closed) surface of revolution, generated with respect to an axis of revolution.

In addition to geometry creation, the focus of this assignment is lighting and shading. Several options for the 3d viewer will be available, and they are detailed in the functionality list below.

Required Functionality

Here are the elements that your program must have.

  • Generation of a surface of revolution (SoR):
    1. Display the axis of revolution.
    2. User inputs the closed generating polygon via mouse picks. (Allow up to 20 input points.)
    3. The polygon is subdivided one or more times using Chaikin's algorithm.
    See this link for a description.
    4. SoR is generated with the number of rotations currently selected, and it should be closed.
    5. SoR is stored in a triangulation data structure as discussed in class.
    6. Face and vertex normals must be calculated and stored.

  • Display modes:
    1. Lighting on & shaded with a choice of flat or smooth. (You must have both available!)
    When in flat shaded mode, use the face normals; When in smooth shaded mode, use the vertex normals.
    2. Lighting on & shaded with wireframe using polygon offset.
    3. Hedgehog: vertex normals displayed. They must be scaled so they are easily seen.

  • Lighting model set-up:
    1. Local viewer
    2. Point light sources
    3. Material properties: user can select from three choices -- give them names, e.g., gold.

    4. Set default material properties from a configuration file. (This will allow you to explore the effects of ambient, diffuse and specular.)
    5. Create two lights. One light remains with the viewpoint and one light rotates about the object. This latter light can be given a pre-specified path, and then animate its movement. (That is, make it rotate about the object on its own.)
    6. Make your lights white.

  • Viewing: Rotate SoR via mouse click and move

  • Perspective in 3D display mode.

  • User interaction
    1. Feel free to do this as you wish: menus and sub-menus, keys, special keys, a viewport with selections, etc.
    2. In the command window of your program, create a list of all the interaction available if keys are used.
    3. Three subdivision levels of Chaiken's algorithm must be available -- course, medium, fine.
    4. Three levels of of smoothness for the surface of revolution must be available. This corresponds to the number of copies of the generating curve.
    5. Flat or smooth shaded toggle
    6. The two light sources can be toggled on/off.
Grading

 

Functionality
   
Updates
Date Update