Advanced Computer Graphics
• Assignment 2 - Procedural Seashell
Due: March 13
Code
- I compiled the started code from source under Mac OS 10.5. I had to include the OpenGL and GLUT frameworks in order to do so in XCode. In addition, in order to get FTLK to compile I had to tweak a lot of settings that aren't worth going into here. Here is a picture of the code running:
1. Splines
- I used the B-spline equations to interpolate the control points of the generating curve. I used a step size of 0.1 to run through the values 0 <= t <= 1 for each of the 10 segments and then rendered the curve using GL_LINE_LOOP to ensure that the loop was actually closed. Here is a picture of a generating curve after a few of the control points have been moved (LOOK it's Pac Man!):
2. Frenet Frames
- Now in order to create the actual sea shell geometry we need to compute the Frenet Frame so that we have a consistent basis within which we can create each segment of the seashell. I computed the Frenet Frame as Fowler suggested, by computing the first and second partial derivatives in each direction for a given point on the helico spiral. With these derivatives, the three basis vectors of the Frenet Frame can be calculated.
- I then implemented a simple system to visualize the Frenet Frame on the helico spiral. By pressing the 'f' key, a user can show the Frenet Frame and then use the '-' and '=' keys to move down and up the helico spiral respectively. In addition I transformed the generating curve points into the Frenet Frame by performing a simple change of basis. The generating curve is also shown on the Frenet Frame scaled by the scaling function that I will describe later.
- Here is a picture showing the Frenet Frame superimposed on the helico spiral:
3. Swept Surfaces
- I then wrote code to actual triangulate the mesh. I did this by first determining a series of points along the generating curve that are equally spaced by arc length. I used the method outlined in the paper to do this. I first computed the total arc length of the curve by using the finite difference method of derivatives to solve for the partial derivatives. I then found n points that were spaced evenly apart in arc length.
- These points comprised the vertices in the mesh and the only left was to create the faces appropriately. The method I used was to enumerate each of the n points and then connect them as such with F1 = (Vi,j, Vi-1,j, Vi-1,j-1) and F2 = (Vi,j, Vi-1,j-1, Vi,j-1):
- I trace around the entire helico spiral, project the generating curve into the Frenet Frame, scale by the scaling function, compute the total arc length, generate the sampling points on the generating curve, and then create the faces.
- The scaling function is an easy way to change the way the radial extent of the generating curve is modulated. I experimented with different functions to produce different effects.
- I also added a few elements to the UI including a slider that controls the number of points along the generating curve to sample and the ability to clear the mesh so that modeling a new sea shell is easier (because you can see the helico spiral)
- Here are some of the results I produced:




- P.S. I stole the parameters for this last one from Mike because my sea shells freaking suck so much because I'm worthless at making them.
© 2008 Sean M. Arietta
University of Virginia