ÿþ<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>15-462 Programming Assignment 2: Roller Coaster via Splines</title> </head> <body bgcolor="#FFFFFF" link="#0000FF" vlink="#AA00AA" alink="#FF0000"> <h1>15-462 Programming Lab 2: Roller Coaster via Splines</h1> <h1>Due Thursday, October 9th, 11:59 PM</h1> <p>&nbsp;</p> <p align="center"><img src="assn2/Example.jpg" alt="img" width="538" height="353" border="2"><br /> </p> <h2>An Overview</h2> <p> For this assignment you'll be deriving a spline function from geometric constraints, and using the function along with several different features of OpenGL to create a roller coaster simulation with a first-person view, allowing the user to "ride" the coaster in an immersive environment. As with the previous assignment, you will create an interesting animation after finishing the program itself. This time, the objective of your animation is to show off both your coaster and the features of your program.</p> <h2>Why?</h2> <p> In the first assignment you used some basic OpenGL functionality but didn't get into anything really interesting (unless you went nuts with extra credit).</p> <p> This assignment asks you to utilize some more interesting features of the OpenGL library in the design of a more significant and entertaining application. In addition, this project gives you a great deal more freedom to be creative in the actual design of your program and the features that go into it; you are asked to create your own solutions to issues involved in the making of your simulation, and to render your coaster as you wish in a world of your design.</p> <p> After completing this assignment, you should have a solid understanding of:</p> <ul> <li><b>Splines</b> &ndash; both their derivation from initial constraints and the use of a custom spline function in OpenGL</li> <li><b>Lighting/Shading</b> in OpenGL</li> <li><b>Texture maps</b> and their use in OpenGL</li> <li><b>Camera manipulations</b> &ndash; the use of transformations to create realistic first-person movement</li> </ul> <p style="font-weight:bolder"> This assignment should be challenging, and will likely take a significant amount of time. However, this should also be a lot of fun! Please start early</p> <h2>Background Information</h2> <p> In order to create the track for your roller coaster, you'll need to render a spline sequence which represents the entire length of your track. Rather than using provided functions, you will be implementing a spline function yourself. This function should take four control points (p<sub>0</sub> through p<sub>3</sub>) and a floating point value (<i>u</i>) from 0 to 1 to trace along the length of the line defined by these four control points. Drawing a single spline from four control points isn't that exciting&mdash;you'll need to use several control points in sequence and draw spline segments along them, starting from the first four points and proceeding until you draw the final spline for the last four points. This will allow you to represent a long, elaborate curve for your coaster.</p> <p> We'll be using <b>Catmull-Rom splines</b> for the representation of your coaster. These will be defined in lecture but you can also look at notes <a href="assn2/catmullRom.pdf" target="_blank">here</a>.</p> <h2>Your Implementation</h2> <p>Make sure you understand Catmull-Rom splines pretty well, then on to the coding itself.</p> <p>Before doing anything else, you'll probably want to visually check your function by drawing some splines to the screen. We provide a set of "track" files containing control points to define some simple spline shapes, and starter code to read in a sequence of these files and convert them to sequences of control points that you can use. It's definitely a good idea to write the code to draw a simple spline sequence and test this before moving on to later parts of the assignment.</p> <p>Next, try setting up the world in which you will actually place your coaster. You can use a plane for the ground&mdash;this should be texture-mapped for realism with an image of your choice. There are plenty of free texture sites on the Web, so google one that appeals to you. After this, create your sky as you wish&mdash;this should also be texture-mapped, and the method of modelling it is up to you. There are issues with many obvious representations, so think about this carefully. Make sure that you can still draw splines as before once you have this set up. Note that the "sky" includes the horizon as well, so simply having a single plane above and a single one below does not constitute an entire sky.</p> <p>Now, implement the ability to ride the coaster. It's easiest to start with your camera moving at constant speed (in <i>u</i>) along the spline before worrying about realism. Properly orienting your camera is a challenging problem! You'll want to have your camera facing "forward" (along the tangent to your spline) as it moves. Also, you need to make the "up" vector of your camera follow some continuous path of normals to the spline. A cheap method to decide your up vector is to always set it equal to the normal of your ground plane&mdash;however, this is totally unrealistic for many splines (think about what happens with loops). Another method is <a href="assn2/asst2camera.html" target="_blank">here</a>. Both of these have their limitations, so you are encouraged to come up with another solution to this problem. <a href="assn2/cameraMovement.pdf" target="_blank">This</a> document may also be useful.</p> <p>Modify the appearance of the coaster itself&mdash;instead of just a line, make your track look like a track! Draw some sort of cross-section, and add whatever details you like. Add lighting to make your coaster look more realistic!</p> <p>Finally, modify the velocity with which your camera moves to make it physically realistic in terms of arc length and gravity. </p> <p>After that's all done, add some fun extras!</p> <h2> Starter Code </h2> <p><b> 64-bit Starter Code: </b> Download <a href="assn2/assn2-StarterCode-64bit.zip">this</a> starter code when working on the 64-bit graphics cluster machines.</p> <p> <b> 32-bit Starter Code: </b> Download <a href="assn2/assn2-StarterCode-32bit.zip">this</a> starter code when working on a 32-bit machines. </p> <p><b>In Windows:</b> The Visual Studio 2005 solution file is also included in both the zip file for a 32-bit machine. The starter code has been set up to be able to build in both Windows and with the Makefile in Linux.</p> <p><b>In Mac:</b> Coming Soon ...</p> <p><strong>Note:</strong> The languages for this assignment are C/C++ or Java. You can code the assignment on any platform but your program must compile and run in the graphics cluster on the 64-bit machines. Implementing your project with the OpenGL library is a must as that is what the project aims to achieve. </p> <h2>Grading Criteria</h2> <h3>Your program must:</h3> <ul> <li>Properly render Catmull-Rom splines to represent your track.</li> <li>Render a texture-mapped ground and sky.</li> <li>Move the camera at a realistic speed in a continuous path and orientation along the coaster.</li> <li>Render the coaster in an interesting manner, using proper lighting (appropriate surface normals, good visibility, realism).</li> <li>Run at interactive frame rates (&gt;15fps at 640x480)</li> <li>Reasonably comment and write code in an understandable manner&mdash;we will read your code.</li> <li>Submit along with TIFF frames for the required animation. </li> <li>Submit along with a readme file documenting your program's features and describing the approaches you took to each of the open-ended problems we posed here (rendering the sky and determining coaster normals in particular). This is especially crucial if you have done something spectacular for which you wish to receive extra credit!</li> <li>Submit to your turnin directory as documented in the submission section.</li> </ul> <h3>Animation Requirement</h3> <p>As in the previous assignment, you are required to submit an animation, represented by a series of TIFF images which are screenshots from your program. We allow for more frames this time as your coaster may take more time to demonstrate&mdash;please name your TIFF frames 000.tiff, 001.tiff, and so on. Do not exceed 1000 frames. The frame rate for the animation, again, is 15fps. Be warned that the animate program installed in the cluster may have problems with excessively large numbers of images&mdash;it may be wise to use it to test subsequences of 100 frames or so.</p> <p>The animation represents a smaller portion of your grade than in the previous assignment, as the implementation of the program itself is much more important and involves much more thinking. You will still receive points, however, for showing off your coaster in a creative manner.</p> <p>A note for those of you who have had trouble dealing with storage for all your images: It is wise not to try to store your frames on your Andrew account, as this will likely fill your quota very quickly. If you have your program write its frames to ./movie, then you can submit it to the correct handin directory for the assignment, run your program, and write your frames directly into the movie handin directory. This avoids worries about intermediate storage. Just make sure your handed in version doesn't output frames by default. When we go to grade your program it shouldn't start outputing frames when we run it.</p> <h2>Submission</h2> <p> Please submit your project to <b>/afs/cs.cmu.edu/academic/class/15462-f08-users/&lt;user_name&gt;</b>. Copy your modified source code into that directory. When we run "make" in the src directory it should compile your program successfully. Also within assn2, make a sub-directory called <b>movie</b>, and place the frames for your animation within, numbered as described above. </p> <p>Right after the assignment deadline, the hand-in directory will be locked. Once the submission has been backed up, it will be reopened for late submission.</p> <p>If you experience any difficulty with the hand-in directory, please email a tar.gz or tar.bz2 of your submission to tagarwal@andrew.cmu.edu. The time of submission will be determined by the time the email arrives at the final mail server. </p> <p>For scp/sftp users: since the handin directory resides on SCS AFS network, your username on the directory is actually  <username>@ANDREW.CMU.EDU , not just  <username> . To transfer your submission to the handin directory please scp/sftp as  <username>@ANDREW.CMU.EDU via weh5336- ?.intro.cs.cmu.edu.</p> <h3>What to submit</h3> <p>Make sure that all files for asst2 go into the asst2 folder. When you submit, <b>also include the following</b>:</p> <ul> <li><b>readme.txt</b> in the root lab dir - Make sure to follow <a href="assn2/lab2readme.txt" target="_blank">this</a> template and describe any extra functions.</li> <li><b>screenshot.tiff</b> in the root lab dir - A good 640x480 snapshot that represents your program in action. Note that we'll be making a summary page with all these shots.</li> <li><b>000.tiff, 001.tiff, ...</b> in the movie dir</li> <li><b>Extra</b> files should go in the root lab dir. Make sure to comment them well in the readme file.</li> </ul> <p>Any failure to comply to the above submission rules might result in misgrading your lab.</p> <h2>Tips</h2> <ul> <li>Start this assignment <b><i>as soon as you can</i></b>. It is a significant endeavor, with many intermediate steps. If you wait until a few days before the assignment is due, you probably will not finish. This project is a lot of fun if you're not rushed, and if enough time is put in the end product is something fun that you can show off to your friends.</li> <li>Reuse any code from the first assignment that might save you some time. OpenGL programs tend to have a fair deal of overlap and this lab has been made to resemble the starter code from the first assignment. Particularly, you might want to borrow some user control functionality, functions to read/write images, and any functions you might have made to automatically write out the frames for your animation. Don't overdo this to the degree that you have an awkward time changing things for this project&mdash;the general structure of your transformations and the state of your simulation will be significantly different from the layout of the previous assignment.</li> <li>Experiment with your own ideas, and <b>have fun</b>.</li> </ul> <h2>Extras</h2> <p>This assignment is much more open-ended as to what you may choose to implement for extra credit. You may be awarded credit for any creative or interesting solution to an issue in your implementation, as long as it is well-documented in your readme file. Below are some ideas you might want to think about if you have the time:</p> <ul> <li>Draw additional features of your track, such as a support structure that looks realistic.</li> <li>Generate your track from several different sequences of splines (multiple track files), so you can shuffle these around and create a random track</li> <li>Secondary animations&mdash;decorations on your track, something interesting in the world nearby, etc.</li> <li>Render the environment in a better (prettier, more efficient, more interesting, etc?) manner than described here</li> <li>Decide coaster normals in a better manner than described here</li> <li>Interactive coaster generation (Disney Quest in Orlando has such a ride where you construct a roller coaster from parts and then ride it in a two person motion simulator)</li> </ul> <p><i>Please note that the amount of extra credit awarded will not exceed 10% of this assignment's total value.</i></p> </body></html>ÿþ