I’ve just finished programming a roller coaster application that was a way to learn Catmull-Rom Spline interpolation. The idea is simply to take a series of low-resolution points representing a general design of a roller coaster, then interpolate these points giving a smooth high-resolution path of the vehicle. What was nice about this application was not only learning about these scene-generation algorithms, but also to learn about OpenGL features I haven’t touched yet: lighting and the texture-material system. The track itself has a slight world-reflection on it (though you can’t see it in the video), as well as lights are scattered around the world.
Check out the video, I give an explanation of other features found in the simulation:
Edit: I’ve been asked by a few programmers on how I calculated my point-normals, that is the normals I used as the camera’s “up” vector. My general approach was to trusts that the previous side vector was “good enough” for the current position and generate an estimated normal by crossing the “good enough” side vector and the accurate forward vector to generate the local-normal vector. To make sure this algorithm keeps working, I saved the side vector for the next point as a vector-cross of the current forward and the “good enough” normal, which can be used for the next point.
Edit 2: I’ve uploaded a non-voiced over high-resolution video of the roller coaster. See below:
3 Responses to Roller Coaster