Project 1: Trains and Roller Coasters

In this project, you will create a train that will ride around on a track. When the track leaves the ground (or is very hilly), the train becomes more like a roller coaster.


Once it becomes a roller coaster, loops, corkscrews, and other things become possible


The main purposes of this project is to demonstrate your fundamental knowledge in Computer Graphics and to give you experience in working with OGRE3D. The core of the project is a program that creates a 3D world, and to allow the user to place a train (or roller coaster) track in the world. This means that the user needs to be able to see and manipulate a set of control points that define a curve to represent the track, and that you can draw the track and animate the train moving along the track. It will also force you to use OGRE3D to create an fundamental interactive framework and proper user interfaces. The framework will be similar to the framework provided for Introduction to Computer Graphics and you can use it as a reference.


Basically in this project you will need to:

  • Create a framework as this one in OGRE3D.
    1. Provide a user interface to look around the world, as well as providing a "top down" view.
    2. You must have a "ground" (so the track isn't just in space).
    3. Provide a user interface that allows control points to be added, removed, or repositioned.
    4. Allow for the control points to be saved and loaded from text files in the format used by the example solution.
    5. Provide lighting.
    6. Allow things to be animated (have a switch that allows the train to start/stop), as well as allowing for manually moving the train forward and backwards.
    7. You should have a slider (or some control) that allows for the speed of the train to be adjusted (how far the train goes on each step, not the number of steps per second).
  • Add the basic functionality:
    • Draw a track based on the control points.
      1. Rail ties: ties are the cross pieces on railroad tracks. Getting them right (uniformly spaced) requires good arc-length parameterization. In the example code, you can turn the arc-length parameterization on and off to see the difference.
      2. Arc-length parameterization: Having your train move at a constant velocity (rather than moving at a constant change of parameter value) makes things better. Implementing this is an important step towards many other advanced features. You should allow arc-length parameterization to be switched on and off to emphasize the difference, you should also provide a speed control.
      3. Control the orientation of track: the simple schemes for orienting the train break down in 3D - in particular, when there are loops. Make it so that your train consistently moves along the track (so its under the track at the top of a loop).
        • One good way to provide for proper orientations is to allow the user to control which direction is "up" at points along the curve. This allows you to do things like corkscrew roller coasters. The sample solution does this (its why the framework has an orientation vector for each control point). Note that the train still needs to face forward, the given orientation is just a hint as to which way up should be.
    • Simple physics: Roller coasters do not go at constant velocities - they speed up and slow down. Simulating this (in a simple way) is really easy once you have arc-length parameterization. Remember that Kinetic Energy - Potential Energy should remain constant (or decrease based on friction). This lets you compure what the velocity should be based on how high the roller coaster is. Even Better is to have "Roller Coaster Physics" - the roller coaster is pulled up the first hill at a constant velocity, and "dropped " where it goes around the track in "free fall." You could even have it stop at the platform to pick up people. Note: you should implement arc-length first. Once you get it right it is much easier.
    • Draw a train on that track.
      1. Have the train oriented correctly on the track.
      2. Have a rider: Little people who put their hands up as they accelerate down the hill are a cool addition. (I don't know why putting your hands up makes roller coasters more fun, but it does). The hands going up when the train goes down hill is a requirement.
      3. Headlight for the Train: Have the train have a headlight that actually lights up the objects in front of it. This is actually very tricky since it requires local lighting, which isn't directly supported.
      4. Multiple cars
      5. Have Real Train Wheels: Real trains have wheels at the front and back that are both on the track and that swivel relative to the train itself. If you make real train wheels, you'll need arc-length parameterization to keep the front and rear wheels the right distances apart (make sure to draw them so we can see them swiveling when the train goes around a tight turn).

In the sample solution, the wheels are trucked (they turn independently), but each car still rotates around its center (so its as if they are floating above the wheels). You can do better than that.

  • Add advanced features
    1. Add shadow: shadow gives the user sense of space. It is important to add shadow in the interactive graphics applications.
    2. Non-Flat Terrain for the ground: This is mainly interesting if you have the train track follow the ground (maybe with tressles or bridges if the ground is too bumpy).
    3. Have the train make smoke: Steam trains are the coolest trains, even if they are being a roller coaster. Having some kind of smoke coming from the train's smoke stack would be really neat. Animate the smoke (for example, have "balls of smoke" that move upward and dissipate).
    4. Add sky with sky box, sky plane, sky sphere, and etc.
    5. Load in models created by blender, Maya, 3DMax, and other 3D tools.
    6. Scenery: having other (non-moving) objects in the world gives you something to look at when you ride the train.
    7. 3 Shaders: Graphics Processing Unit(GPU) has become very important aspect in graphics. We would like to explore the usage of them such as environment map, particle simulation, water simulation, and so on. Everyone has to write 3 shaders
Grading Criterion

This project is similar to those in Project 3 and Project 4 in Introduction to Computer Graphics. Therefore, the score is the advance features in Project 3 and Project4 without the water feature (we will implement it in P2)

What to handin
  • a readme.txt which should explain the following:
    1. A list of all the features that you have added, including a description, and an explanation of how you know that it works correctly.
    2. A discussion of any important, technical details (like how you compute the coordinate system for the train, or what method you use to compute the arc length)
    3. Anything else we should know to compile and use your progra
  • 3 screen shots
  • Source code and media information
  • A 1~2 minutes video

郤威麟, and 翁世璋, Trains and Roller Coasters -- 郤威麟、翁世璋


李梓含, and 蘇亭霖, Trains and Roller Coasters -- 李梓含、蘇亭霖


Leshchenko Illia, and Havard Kittelsen, Trains and Roller Coasters -- Leshchenko Illia、Havard Kittelsen