15-462 Programming Assignment 2 - Roller Coasters and Splines

Due Tuesday October 12th midnight

Overview

In this assignment, you will be working with splines and some features within OpenGL. You will be designing a roller coaster and the surrounding world. Also a "ride the coaster" feature will be implemented.

In order to create a roller coaster, you will have to draw a spline to the screen which represents a roller coaster. After the spline is drawn to the screen, you need to draw the rest of the track so that while you are riding it, there is a feeling of speed. All parts of the track that you draw should be shaded properly. We will give some sample Catmull-Rom track files, however, you should try to create your own roller coasters. There is some starter code which loads multiple spline files and stores them into an array of splines. For more information about splines in general, you can look at the class slides for September 28th or [Shirley, Ch. 13]. More specific information on Catmull-Rom splines is also available.

After the roller coaster is created, you should be able to ride the roller coaster by having the camera follow the track. When travelling along the spline, you need to keep track of where the camera is, where its looking at, and the up vector for the camera. See the additional camera instructions on how to do this. To make the feeling of riding a coaster seem complete, you should create a ground plane and sky, these should be texture mapped so that everything looks nice.

Functionality Requirements

This is the list of requirements that are required for the assignment. The order that they are in would probably be a good order to implement them while working on the assignment.

Animation

In addition to your program, you are also required to hand in an animation in the form of JPEG files. Use the same code that you used from Assignment 1 to save the files.

Grading

Submission

Please submit your code along with your makefile to /afs/andrew/scs/cs/15-462/students/your_andrew_id/, in a sub-directory called asst2. Running "make" in this directory should compile your program successfully--if not, you've left out a necessary file. Within this directory, in a subdirectory called movie/ copy all your JPEGs into it. Number them consecutively starting from 000.jpg; no more than 180 frames will be included in the video.

Please also include a README file that describes your "physics" model, as well as any extras you implemented.

Starter Code

The starter code takes a file at the prompt which contains a list of splines to use and an integer which specifies the number of splines listed in the file. There are two samples called spiral_track and test_track. The code will then load all the splines from that file into a structure called splines. Splines is an array of spline structs. Each spline struct contains an integer which has the number of points, and an array of coordinates.

As usual, you are free to use any language you like, but we will only actively support C and C++, and we will require that your code compile and run in the graphics cluster.

Tips

Possible Extras

Links