CS 770/870
Assignment 4. Hermite Splines, Lookat, Animation

Purpose: learn about splines, learn about 3Dmodel construction. Learn to control viewpoint.

You will create a roller coaster track with a box cross section. This will be created in 3D using Hermite splines where the control points are randomly defined using an algorithm of your own devising.

Suggestion: use 11 spline segments with each spline further subdivided into 100 sections.

The track box should be strored using arrays of X,Y,Z positions (one for each corner) and a set of three orthogonal vectors defining the sideways forward, and top directions.

The vector defining the top of the track should be defined for each track section. using the normal for the previous section and the forward direction of the current section. Take the cross product of these to get a sideways vector. Then that the cross product again to get the new top vector.

Extra points if you can make the spline into a closed loop with no discontinuity.

The top of the stack should be colored with alternating white yellows stripes, each 5 quads wide. The bottom and sides of the track should have alternating gray and cyan stripes.

The track should be properly lit and FLAT shaded.

A sphere should be placed just above the track and animated along it. When it gets to the end it should jump back to the beginning. There will be two user-choosable options for the camera. A wingman view, or viewpoint from above and behind the moving sphere.

Your progam should do the following

The 'c' key should create a new track.

The 'a' key should start and stop the animation.

The 'v' key should change the view from wingman to above and behind and back.

Due: Nov 4 by email (cware@ccom.unh.edu)

Deliverables: source code in a single file

A description of the code architecture. Describe each of the major components.