Project 5: Rolling coin (simplified version)
CS3451 Spring 2008
Due April 21 before class
The objective of the project is to roll a coin on a 3D mesh. This is not a team project, you are on your own.
You may, but do not need to, use the mesh viewer code provided for the previous project and any code that I have posted or that you have developed in your previous projects. You should post your project web page with the usual header info, an interactive running applet, a link to the source code (which should be commented and have headers with your name), and a PDF file with a short report explaining the details of your solution (as indicated below).
You may substitite this project for a harder or more interesting one, provided that you give me a brief description very soon and get my approval.
Let the user pick (key 'r') a point S0 on a triangle T0 of the mesh and select a direction D0 that is tangent to T0. The point will be traveling from S0 along D until is reaches the border of T0.
Compute the edge E01 at which we leave T0 and the point S1 where we hit that edge. Explain the computation of E01 and of S1 in the report.
(Suggested precaution: If you find that S1 is very close to a vertex of the mesh, you shoulod consider tweaking its position along E01 slightly further form the vertex, so as to avoid dealing with singular situations.)
Compute the reflected direction D1 which will be the direction of the geodesic travel on the next (adjacent) triangle T2. D1 is the reflection of D0 with respect to a plane that contains E01 and has normal N01 that is the average of the normsl to T0 and T1. Explain the computation of N01 and D1 in the report.
Iterate this process to walk from one triangle to the next, collecting points Sj and their associated normals Nij. Make a picture of the result of a short walk throough some 30 triangles with the normals scaled by r.
Program a key ('t') to extend the path by one additional triangle, so that we can use it for step-by-step debugging or for animating a runner (keep 't' pressed and see the path with spikes (normals) extend). If your computation is correct, the path should follow a geodesic. Find the definition and property of geodesic paths and insert explanations in your report.
Use a technique learned in class to smooth the normals along the path (when key 's') is pressed. In your report, show the before-and-after images of the smoothing and riefly explain in the report your smoothing technique.
At the end of the current path, render a polygonal approximation of a disk, which should be about 20 times smaller than the triangle mesh. Texture map your face on it.
Produce an animation which rolls the disk on your geodesic path so that the it does not slide and remains aligned (i.e. normal to the surface and parallel to the path). We assume that the mesh has been refined, so you need not worry about generating frames between the computed points on the path.
Include in your report a few pictures showing your coin in consecutive positions so that we can clearly see your face on the texture rotating with the coin as it rolls.
The proposed approach may sometimes produce an animation that is not physically correct. Explain why and show an example of this PROBLEM.
Extra credit (up to 20% each):
(1) Suggest in the report how to fix the PROBLEM you have shown above, implement the fix, show results.
(2) Let the camera follow the coin as if we were dragged by it while floating above the surface. Let the user control (by dragging the mouse horizontaly or vertically) the direction and velocity of the coin to drive it on the surface.