4451 Project 1

Each student should have emailed to the TA the url of a pesonal project page for 4451.
This page should contain the list of links, one per phase of Project 1, to separate pages that show your results (images, critical examples of code,  explanations) and point to the source code (with comments), makefile, datafiles, and whatever else is relevant.
Please clearly label each link and mark it with the date when the project phase pages it leads to were last modificed.

Given that many of you had trouble getting started or joined the class a bit late, there will be nopenalty for being late for phases 1a and 1b. However, we will knock points off if you have not posted the results for phases 1a, 1b, and 1c by Sept 2, before class. The penalty will be modest (say 5% per day), but is intended to motivate you to start early. if you have a valid reason for being late, please contact the TA to ask for a short extension.

I suggest that you look at the clickpoly.c example that the TA has produced for you and at the implementation of the subdivision schemes that students have produced in prior years. See Winter 2002 projects for example. You are welcome to use these examples, provided that you give cledar credit as to where from you copied what and that you put on your own comments. However, if you use someone else's code, you must clearly demonstrate that you understand completely this implementation by modifying it in drastic ways (to make it more elegant, faster, prettier...). You should explain briefly what you have modified and why. You also need to produce your own data sets and images. Plaese use a white background and reasonably thick lines for the drawings.

The first 4 phases are to be done individually. The last phase is to be done by teams of 2. If you do not have a partner, please notify me in class. I suggest that you start working on the final phase early on, because it involves 3D graphics and animation. If a team wishes to do this in an environment that is not OpenGL+GLUT, please inform your TA and arrange for a quick demo of the final project. Otherwise, ensure that the TA is able to (compile and) run your final program by posting the necessary files and instructions on the web page.


Phase 1a due  Aug 19
Find a suitable software evironment and learn how to write a program that draws lines in desired colors (C with OpenGL, Processing...). Post on the web which environment you will be using, a simple program that draws a triangle with edges in different colors, and the resulting picture.
 
Phase 1b due  Aug 26
Implement a Polyloop editor as described in the slides from lecture 01. Post the source code and several images of viarous polyloops with links to the associated data files.
Support rescaling to fit a larger curve in the viewpoint if desired. Explain briefly the functionality of the program. Extend the user interface to enable the user to select what curves are to be displayed (user can toggle on/off each curve independently) and the level of subdivision (how many times the original polyloop is subdivided).
 
Phase 1c due  Sept 2
Implement and demonstrate the uniform 4 subdivision schemes studied in class (Quadratic B-spline, Cubic B-spline, Four-point, and Jarek). Show results on several carefully chosen data sets (different colors) and point out the different properties of the schemes.
Look at http://www.gvu.gatech.edu/~jarek/Split&Tweak/ for inspiration.

Phase 1d was originally due  Sept 9, now it is due Sept 14
In the first part of this study use the four-point subdivision only.
Assume that the subdivided polyloop is parameterized by the parameter s. For simplicity, s is an integer that goes from one to the number of vertices in the subdividd polyloop.
Compute the normal vector N(s) and radius of curvature r(s) at each vertex P(s) of the subdivided polyloop (for a user chosen subdivision scheme and level). Visualize this information by showing a radial line, i.e., the line segment from each vertex P(s) of the subdivided curve to the corresponding center G(s)=P(s)+r(s)N(s) of curvature.

Note that r(s) is infinite for flat portions and that in portions where the curve is nearly flat, the center G(s) may be off screen. Debug your implementation on one vertex and then, to make the picture more readable, display for each vertex P(s) a curvature line that is the line segment (P(s),G'(s)) where G'(s)=P(s)+(1/r(s))N(s). This way, the length of the curvature lines indicate the magnitude of the curvature, and not the radius of curvature.

To compute the radius r(s) of curve at a vertex P(s), we will use the letters A, B, and C to denote three consecutive vertices in the polyloop, with B being P(s).
 B=P(s);
 A:=B.previous;
 C:=B.next;
 V:=AC/2 ;
 N:=AC.unit.left ;
 r(s) := V*V / (2BC*N);
 
If this construction works, explain what it does (maybe use a drawing) and show that it does produce correct results. If you believe that the formulation above does not work, discuss the problems in class or with colleagues and fix it. Explain what was wrong and how you fixed it.

Explain what happens if you start with a perfect square of side-length L and subdivide it a few times.
Is r(s) identical for all vertices in a given subdivision level?
Pick a vertex of the initial polyloop. Track it through the subdivision steps and report how the associated radius of curvature varies as you perform subdivisions. Does it converge? To what? Compare this value to the radius of the circle passing through the four initial vertices.

Compare this method of computing N(s) and r(s) to an approach that fits a circle through points A, B, C, as discussed in the practice quiz.  Make sure that you understand the method. It computes G(s). You need then to use the vector G(s)-P(s) to compute r(s) and N(s). Explain how you do that.

See whether these two methods converge to yield identical r(s) for each P(s) as the polyloop convegres to the final curve, when you subdivide it. I am not asking for an analysis, but for a visual conclusion. (Maybe you want to draw the radial lines in one color for G(s) computed with the method above and in another color for G(s) computed as the center of the circle fit through A, B and C. Are the line segments identical initially? Do they become identical as you continue subdividing?
Try this on a polyloop that has a zig-zag.

In conclusions, answer the following questions:
Are these methods equivalent?
If not, what are the differences?
Do they produce the same result in the limit?

Now pick your favorite formulation for computing r(s) and N(s).

Now, that you have a tool for analyzing the curvature, let's use it to compare the four subdivision schemes.
Make sure that you use an interesting polyloop that has a zig-zag and a sharp corner with where two dges with unequal length meet.

For each one of the four subdivision schemes (quadratic, cubic Bspline, 4-point, jarek), use the same curve and produce a row of 4 images, showing the results of 1, 2, 3, and 4 levels of subdivision.
In each image, show the curvature lines for each vertex of the subdivided polyloop.
That is a total of 16 images.

Study these images and draw conclusions on how the choice of the subdivision scheme affects the smoothness of the curves and the continuity of the curvature. Be very clear in your statement. Which subdivision schemes yield a curvature-continuous curve? What leads to that conclusion?

Phase 1e due  Sept 21 (team)
Use naive physics to compute the tilt of a bike that would lean into the turns while traveling along the curve. (At each vertex of the subdivided polyloop, the bike should remain parallel to the curve. use the tangent or velocity vector V(s) to establish that direction. One method computes V(s) as (C-A).unit. The other computes V(s) as the unit vector orthogonal to (P(s),G(s)). Explain which one you are using.

Initially, show a picture where the bike is vertical and aligned with V(s) at P(s). Make a picture showing the bike at a subset of the vertices.

You do not need to make a fancy bike: maybe 3 disks, one for each wheel and one for the head of the rider and a triangle joining their centers. The bike should be small compared to the curve (think of the curve as being the centerline of a winding mountain road). But if you make it too small, it will be difficult to see its tilt.

Then, show the same figure with the bike tilted into the turn. Explain the physics clearly on your web page. If you used other web sites or books to refresh your knowledge of mechanics, please include the references. Use a clear figure to explain.

Produce a single image using superposition to show the position and tilt of the bike at every k'th value of s. (stroboscopic effect). Compute k so that the consecutive bikes to not interfere. Also explain how you propduce and render the image (maybe include the relevant subsets of OpenGL).

Do this for each one of the 4 subdivision schemes, starting with the same control polyloop and performing the same number of subdivision steps. Produce the superposed (stroboscopic) figure of the tilting bike for each scheme.  Compare the results and discuss the merits of smoothness and C2 continuity. Comment on the realism bike's poses. How would you improve it?

Bonus points for those who already have some experience with OpenGL or who are quick learners:

1) To enhance visibility, please use  a polygon for the  ground.  One of the OpenGL example files provided does a texture map of a checker board. You may try mapping it on the ground.

2) Produce an animation (enable doublebuffering and swap the buffers between one pose and the next). Capture it as a very short low resolution (maybe 150 frames at 200x200 pixels) video . Do it for each subdivision scheme.

3) Show the ride from the eyes of the driver (leaning with the bike). Capture it for the 4-point and for the cubic-Bspline. What do you conclude?

3) Show the ride from a parachute dragged behind the bike (not leaning, but looking down at the bike).

The team may produce a single web site for the final phase, which should contain the names of the team members but not the links to their private project pages (which should remain secret). Furthermore, each team member must include in his/her personal project page a link to this joint phase 1d page and specify the name of the partner.