CPS 124/296.3
Fall 2001

Trains

The purpose of this assignment is to help you understand how to build and manipulate objects in 3D space.

Specifications

Create a program that allows the user to create a train track along your terrain and to animate a train that moves along that track.  Optionally, the track can be specified as an image that is the same size as the one that represents the terrain, but in which white indicates there is no track on that area of terrain and black indicates track is present. The most basic track would be a single thick line lying on the terrain. The most basic train can be drawn as a rectangular box with something to distinguish its front from back. The train should simply stop if it runs off the tracks (crashes are extra credit :).

If no track image is specified, or if the user wants to modify the basic track, she must be able to interact with the elements in your scene. However, interacting with objects in 3D is a very hard problem --- especially given that your primary input device, the mouse, is a 2D pointer. The most basic user interface would treat the 3D space as a 2D grid by providing a top-down orthographic view of the world and allowing the user to put pre-built track pieces down in grid-size pieces. While this is not the most flexible interface, it is probably a good one to implement first (and then improve as time permits).

The user of your program should be able to control a variety of options within your scene using the keyboard. You may choose which keys control which functions, but make sure they are clearly documented in your README file.

Allow the user the following controls
add track paths to the terrain
change track already laid on the terrain
start and stop the train running along the track
place multiple cameras in the scene and switch between their view
view any part of the terrain by using the mouse as a virtual trackball
quit the program

Extra Credit

There are many parts of the homework that are open ended. You can earn bonus points with extremely creative and intuitive solutions. Make sure that you mention your assumptions, extra features, and how to run your program in your README file.

To get you started, here are some extra credit ideas

model train's movement on track (somewhat) realistically
model tracks as spline curve and allow user to edit curve
make tracks that do not just lie on the ground, i.e., allow rollercoasters
allow user to modify track on terrain while the train is running
allow user to add multiple cars to train that remain attached as it runs
allow user to assume a view from the train as it moves along the track
allow user to modify the terrain as well as the track (this should update the corresponding track automatically)
allow user to save modifications

Resources

A tutorial on creating a virtual trackball is in the red book (the mathematics behind it are online)

A simple curve editor

A Survey of 3D Interaction Techniques by Chris Hand

TrackPlanning.com

 

Feedback?