Return to Home
About DLS
See what's in the works!
Click here for various programming and media resources.
Links to the world



Humanoid Animation Project:
How it works


[Main page]   [How it works]   [Screenshots]




The following is a list of features that can be found in the demo, and a detailed explanation on how each of them was implemented:

The humanoid model

The humanoid model used in this program is based on the MPEG-4 virtual body model. The MPEG-4 body model contains a number of "joints", which connects and controls different parts of the human body (see image on the right).

In the program, a total of 19 major joints and 19 body segments have been used (as a minimum requirement). In order to clearly distinguish between the joints and segments, a series of blue rectangular boxes have been used to model the body segments, while the joints are modelled using smaller dark red boxes (see below).



Animations

The program allows for a range of animations to be performed, both by the "diver" humanoid and the "spectator" humanoid. Gestures like stretching and bowing are included, and a few diving maneuvers including somersaults. These animations are created using keyframe animation techniques, in which the animation keyframes are defined using custom made scripts stored in text files.

Each and every gestures made by the humanoid is defined using a HAF (Homemade Animation File), which provides essential information such as the total number of keyframes in the animation, the different joint rotation angles at each keyframe, etc. When the animation is called, the program will read in the script and perform the moves using linear interpolation techniques.


Rendering environments

Another major focus in this assignment is the rendering of the scene. A wide range of scene rendering options have been included in the program, including:
  • Lighting
  • Flat/smooth shading
  • Solid/wireframe rendering modes
  • Textures and fog
It has been observed that rendering the background seems to take a huge toll on the frame rate. One possible solution to improve the performance is to use smaller textures or convert them to 8-bit, 256 colors.


Extras

Other not yet mentioned features implemented in the program include:
  • Animated textures: The pool water texture is animated using a simple technique of altering the texture coordinates in the pool model.
  • User joint control: Allows the user to shape the humanoid to his/her liking using simple controls to rotate the major body joints.
  • The 'spectator' humanoid: The spectator model is an identical copy of the diver humanoid, with its own specific animation scripts. For example, when the diver humanoid performs a well-executed move, the spectator humanoid will clap its hands in admiration.
  • Camera angles: The user can switch between one of the three predefined camera positions to get a different view of the scene. The camera angles can also be altered using keyboard controls.



Design and Implementation

The entire program is written in C++, and contains two major classes: HumanModel and PoolModel. Both classes are designed to be as modular as possible. As in the case with multiple humanoid objects, I find it quite easy to add additional humanoid/pool objects this way. I have to admit at this point that the classes could've been further divided into more abstract objects... but for the purposes of the demo I tried to keep it simple.

The program uses the tree traversing technique to render both the humanoid models as well as the pool model. In the pool model, I have broken down the different parts into nodes and link them together in a tree similar to the humanoid model. The rotations performed in animation and user joint control are integrated into the traversing procedures.

The surrounding background is constructed using two matching bitmap sky textures. I was thinking of using a 'backyard' style texture, but was unable to find one...

The main program (hanim.cpp) controls all aspects of the environment. It also contains a bitmap (.bmp) reading function (obtained from NeHe OpenGL tutorials), which is used to read in the textures. Unfortunately I couldn't find a 8-bit bitmap loader function that will work on both Windows and Linux platforms.

The notion of reading in a 3DS/OBJ model file was a bit tempting at first, but I had decided against it in the end for two reasons:

  1. Modelling takes too much time - each body part will have to be created and loaded individually, which can cost more time than it's worth.
  2. Rendering the model in boxes will make it easier to see the structure of the humanoid model. Since one of the major goals is to implement a MPEG-4 virtual body model, it would be a shame not to be able to show off the complexities of the model structure.

Alright, that's it. I've aired all the dirty laundries, feel free to send me comments/suggestions. ;-)



Home   About DLS   Projects   Resources   Links  

All contents on this website are © DLS Productions 2000-2002.