CSE 40166 / 60166 - Computer Graphics

|    Home  |   Syllabus  |   Assignments  |   Schedule  |   Resources   |

Midterm Project - Roller Coaster

This assignment is due by October 8, 2012 by 11:59pm.
Please note that October 8 is a MONDAY.


Part I - Roller Coaster!

For this assignment, you and a partner will write a fully-featured GLUT/OpenGL roller coaster simulator. Your program will load a file which contains the specification for the roller coaster track (a list of control points that define a Bézier spline) as well as a listing of objects that make up the scene - as simple as basic GLUT/GLU primitives, or more complex, custom defined objects; a custom-designed roller coaster car will loop smoothly around the track, and the user will be able to experience the action from multiple viewpoints.

Please email your groups to the instructor and TA no later than Tuesay, September 25 4:45pm.

The assignment is comprised of several smaller parts, each focusing on one of the topics covered to this point:
  1. Roller Coaster Track (Bézier Curves)
  2. Roller Coaster Car (3D Drawing)
  3. Cameras & Menus
  4. OpenAL
  5. Lights & Materials
  6. Text
  7. File I/O
  8. Extra Credit: Textures


Part I.A. - Roller Coaster Track

You and your partner will create and render a Bézier spline from the control points - the curve must be closed (the start point and end point must be the same) and therefore C0 continuous. The curve must also be C1 continuous (smooth), although you can assume that the input file will meet these requirements. You must parameterize the curve based on arc-length; in other words, you must be able to find the point along the curve which is d units along the curve, for any value of d less than or equal to the curve's total length.


Part I.B. - Roller Coaster Car

You and your partner will make an animated car that moves smoothly along the spline, rotating itself correctly as it goes. As with the vehicle assignment, your car must be comprised of some number of GLUT primitives or GLU quadrics, be hierarchically structured, and must be animated.


Part I.C. - Cameras & Menus

Users will be able to experience your program from one of three viewpoints: (1) from an arcball camera that can rotate around and follows the vehicle; (2) from a free cam that can move about the scene; and (3) from a camera mounted on the front of your roller coaster car giving the car's point of view. The user should be able to toggle between camera modes through a menu tied to one of the mouse buttons. When the point-of-view camera is turned on, it should appear as a picture-in-picture viewport within the window. Feel free to add additional cameras beyond the three listed (Sky cam, Side-scrolling cam, Third Person cam, etc.) The camera class from Homework 4 should make this task significantly easier so be sure to have camera.h and camera.cpp files.


Part I.D. - OpenAL

You and your partner will add sound to the roller coaster simulator using OpenAL. You must use at least two separate sounds and at least one of them must be triggered to some activity (a user stopping/starting the roller coaster, screaming when the roller coaster descends a steep slope, clicking when the roller coaster climbs a steep hill, etc.). The other sound(s) may be ambient (birds chirping periodically) or tied to the environment (crowds of people nearby cheering, which can be heard growing louder and softer as the roller coaster passes by). There's a lot of fun stuff that can be done with audio!


Part I.E. - Lights & Materials

Your application must include a meaningful application of lighting. It must include at least two lights and one of them must be animated or dynamic in some way - light position can be tied to objects in the scene like headlights; a strobe light could change colors according to the roller coaster's speed; compare an outdoor roller coaster to one that is in a tunnel or one that is indoors like Space Mountain. There should be some amount of ambient light to be able to view your entire scene. Just as the cameras have their own class, lights should be set up in their own class as well. Be sure to include light.h and light.cpp files.
         Remember that lights exist not only to communicate shape and depth but also contribute substantially to the feel of the scene! Experiment with light positions, colors, and intensities to get a particular look and feel. Generally, you can get good results with slightly off-white lights of complementary colors - check out COLOURlovers for some nifty color palettes, as well as tools to help you choose sets of complementary colors.

In addition, the objects in your scene must have appropriate material properties using at least two materials. If your roller coaster is made of steel, then perhaps it should be quite shiny and reflective. Opposed to a wooden roller coaster that has a very flat appearance. The color we perceive an object to be is a combination of the lighting present and the material of the object. Experiment with different material properties to acheive various effects. As with the other classes that are used multiple times, set up a Material class in a material.h file.


Part I.F. - Text

Lastly, display somewhere to the window (typically in one of the corners) the current real-time Frames Per Second rate of your application. Frames per second is exactly what it sounds like - the average number of frames rendered in one second. Be sure to check some of the tutorials linked on the resource page if you are having trouble doing the calculation. You may use either stroke text or raster text, which ever is more appropriate for your application. Feel free to use additional text in your scene to make signs or scrolling marquees.


Part I.G. - File Format

The format of the roller coaster file you will read as input is up to you to define. In your file format, a designer must be able to specify the location of control points, as well as the location and type of objects to be placed in your scene. An example format might look like:

<number of control points>
<control point x> <control point y> <control point z>
...
<number of objects>
<object type> <object x, y, z> <object size>
...

As stated above, your file format is up to you to define; however, you must be able to place at least two different kinds of objects, which can be as simple as GLUT/GLU primitives, or more complicated, like a flag or a tree. You must describe your file format in your README.txt file. To demonstrate that your roller coaster program can read in roller coaster spec files correctly, include two example files with your program. They must each utilize the full functionality of your file format (i.e. must each contain objects placed in the scene and must each specify control points for a valid roller coaster).


Part I.H. - Extra Credit: Textures

For extra credit, you may choose to add textures to your roller coaster simulator. We will introduce texturing the week of October 2 but you are encouraged to read ahead and add a sense of realism to our world. To satisfy the extra credit, you must feature at least two different textures. They can be used on your rollercoaster car, on objects throughout the world, or even on a plane that covers the ground or a skybox, as long as they make sense in context (i.e. a repeated texture for the ground). Be sure to use sensible filtering for each texture as well. For example, if a surface contains a highly detailed and repetitive texture, it should use mipmapping to avoid aliasing.


Part II - Website

Update the webpage that you submitted with HW4 to include an entry for this homework assignment. As usual, include a screenshot (or two) and a brief description of the program, intended to showcase what your program does to people who are not familiar with the assignment. Both you and your partner must update your webpages. You may both use the same screenshots and writeups if you wish.


Part III - Presentation

In class on Tuesday, October 9 you and your partner will make a 5 minute presentation demonstrating your application's key features. There will be a machine set up to run your project. Use this time to show off all of the cool extra features you added into your project! The quality of your presentation will count towards part of your participation grade.


Documentation

With this and all future assignments, we expect you to appropriately document your code. This includes writing comments in your source code - remember that your comments should explain what a piece of code is supposed to do and why; don't just re-write the code says in plain English. Comments serve the dual purpose of explaining your code to someone unfamiliar with it and assisting in debugging. If you know what a piece of code is supposed to be doing, you can figure out where it's going awry more easily.

Proper documentation also means including a README.txt file with your submission. In your submission folder, always include a file called README.txt that lists:
  • Your Name / netID
  • Homework Number / Project Title
  • A brief, high level description of what the program is / does
  • A usage section, explaining how to run the program, which keys perform which actions, etc.
  • Instructions on compiling your code
  • Notes about bugs, implementation details, etc. if necessary
  • NEW: A description of the file format that your program reads as input
  • NEW: A rough distribution of responsibilities / contributions of each student

Since you and a partner will be submitting the assignment together, please mention in your README.txt (1) who your partner is and (2) which of your dropboxes contains the final submission. You are both expected to create a midterm folder in your dropboxes and include a README.txt file, although the files may be the same.


Grading Rubric

Your submission will be graded according to the following rubric:

PercentageRequirement Description
5%Roller Coaster curve is C1 continuous. (This doesn't need to be enforced in-program, as long as input control points specifiy C1 continuous curves.)
5%Roller Coaster curve is closed (end point = start point) and C0 continuous.
10%Curve is parameterized based on arc-length and moves at a constant speed regardless of control point spacing.
5%Roller Coaster car is animated.
5%Roller Coaster car rotates correctly as it moves along the curve.
5%Roller Coaster car moves correctly around the track.
5%Roller Coaster car is comprised of GLUT primitives / GLU quadrics.
5%Two different lights used along with two different materials. Used as described above. Lights are defined in a light.h file and Materials are defined in a material.h file.
5%Arcball camera follows vehicle and rotates correctly; user can control rotation. Camera is set up in camera.h file.
5%Free camera is correctly implemented, can move around the scene, and is user-controllable.
5%Camera from vehicle's point of view works correctly; it is attached to the car and looks along the tagent of the curve. Camera view is placed in a separate viewport.
5%User can toggle between cameras through use of a menu attached to a mouse button.
5%Two different sound files are used and tied to the environment appropriately.
5%The listener and sound sources are placed correctly.
5%Frames Per Second are rendered to screen.
5%File format is documented in the README.txt file. A third-party should be able to write a roller coaster in your format based on your documentation. File format supports two different types of objects that can be placed in the scene and objects are correctly placed and rendered in the scene.
5%Two non-trivially different example files are included. Each example fully utilizes the file format (i.e. places objects of each type).
5%Submission includes source code, Makefile, and README.txt.
Source code is well documented. Webpage named <afsid>.html submitted and updated with screenshot from latest assignment.
5%Submission compiles and executes in the lab machine environment.

Part I.H. - Grading Rubric

  • This section will count as an additional 1% of your final course grade, with the 1% being broken down as follows.
PercentageRequirement Description
30%Two different textures are used.
35%Textures are correctly read in from file.
35%Sensible filtering is applied to each texture.


Submission

Please update your Makefile so that it produces an executable with the name midterm. When you are completed with the assignment, submit the source code, Makefile, and READEME.txt to the following directory:

/afs/nd.edu/coursefa.12/cse/cse40166.01/dropbox/<afsid>/midterm/

Similarly, title your webpage <afsid>.html (e.g. jpaone.html) and submit it to:

/afs/nd.edu/coursefa.12/cse/cse40166.01/dropbox/<afsid>/www/

Place any screenshots or other images used on the webpage in:

/afs/nd.edu/coursefa.12/cse/cse40166.01/dropbox/<afsid>/www/images/

This assignment is due by October 8, 2012 by 11:59pm.
Please note October 8 is a MONDAY.