CMP 161 - Final Project
Winter 2009

Hula!
Grass Skirt/Lei Animation

Corey Brennan
cebrenna@ucsc.edu




Platform:

  • Windows XP
  • MSVC++ 2005 Express, FLTK, OpenGL
Description

Animation of a grass skirt and lei working with a GUI.

I tried several different strategies before deciding on a sticks/particles method using FLTK with OpenGL:
  • Strategy 1: ODE (Open Dynamics Engine). This engine was designed for rigid body dynamics. That is, the pieces in this engine are mostly joints working together in complex ways. The biggest obstacle towards using this was that ODE is not designed for fluid body dynamics, like cloth simulations. This exploration led to...
  • Strategy 2: FLTK with Open GL cloth. This model was designed for stretchy fabrics, with lots of springs. It was more complex than I needed it to be; grass skirts and leis do not stretch much. So I opted in favor of...
  • Strategy 3: FLTK with Open GL sticks/particles. This model was the right fit; it allowed the OpenGL models to bend without having to worry about excessive stretchiness or the extra complexity.
  • Mini-Conclusion: Using an existing engine cuts into implementation time, especially when using an engine that's unfamiliar. Also, having a multipurpose catchall solution isn't always the right fit for the job; it wasn't in my case.
The rest of this document explains more deeply the ideas of the project:
    Animation Math
  • Integration is necessary to get a frame of animation based on physics; you basically follow the existing formulae for motion based on the integration style of your choice. Euler works, but it tends to have much more error as time goes on. So, I opted in favor of Verlet, an alternative method that uses positions to calculate velocities internally, rather than using Euler's somewhat more external velocity method. According to the Wikipedia article on numerical integration, Euler is a first-order method of integration, Verlet is second-order, and finally, Runge-Kutta is higher order. RK4 is a method of integration in the family of Runge-Kutta integrations.

    Using FLTK for a GUI
  • The GUI I designed for this project was a simple adaptation from an earlier draft. The earlier draft is among the pictures on the media page.
  • I added some extra options to make the animation more interesting. For example, clockwise and counterclockwise do not accurately describe the motion of a hula dancer. Those options more closely mimic the actions of a person using a hula hoop. The Figure 8 option attempts to show what it looks like with actual dancing.
  • The V option, similarly, attempts to show a common routine might look like.
Compilation

Making sure that all the header files and libraries are available, press F5 within MSVC++ 2005 Express with the Hula!.sln file open.

Execution


Brief User Guide

Use the radio buttons and checkbox to signal to the program what you want it to do.

Playback

Restart starts the program from the beginning.
Stop ceases the motion of the "dancer"; the motion of the skirt and lei will continue.
Paused stops all motion until the Paused checkbox is cleared.

Style

Clockwise moves the "dancer" in clockwise circular motions.
Figure 8 moves the "dancer" in an actual dance motion, like a Figure 8 with the hips.
Counterclockwise moves the "dancer" in counterclockwise circular motions.

Traveling

Forward and Back moves the "dancer" forward and back.
V moves the "dancer" in a V formation.
Left and Right moves the "dancer" left and right.



Source Code

  • Source


  • Media

  • Media


  • Further Experiments

    If anyone develops this idea further, here are a few ideas.
  • Give the option to try other kinds of integration, ie Euler and RK4.
  • Illustrate a dancer model performing these actions.
  • Give the option to choose between shading styles or move lights.


  • A Final Update

    So far, at the due date and time, I have a GUI and a grass skirt animation. The GUI doesn't control the animation, and the lei is not working properly, so I took it out.

    Credits

    Moller, Tomas, Eric Haines, and Tomas Akenine-Moller. Real-Time Rendering (2nd Edition). AK Peters, Ltd., 2002.
    "Numerical ordinary differential equations -." Wikipedia, the free encyclopedia. 18 Mar. 2009 <http://en.wikipedia.org/wiki/Numerical_ordinary_differential_equations>.
    Pallister, Kim. Game Programming Gems 5 (Game Programming Gems Series). New York: Charles River Media, 2005.
    Parent, Rick. Computer Animation, Second Edition Algorithms and Techniques (The Morgan Kaufmann Series in Computer Graphics) (The Morgan Kaufmann Series in Computer Graphics). Greensboro: Morgan Kaufmann, 2007.


    Also, the CamStudio Video Suite was a very helpful utility for getting screen captures on Windows. Best of all, it's FREE! Yay, free!