COSC1187 Interactive 3D Graphics Semester 1 2002
Humanoid Virtual Body Animation

Overview Functionality Design Usage Screen Shots References

Name:Nirisha Shrestha

Student Number: 9912673U

Department:School of Electrical and Computer Engineering

email: s9912673@student.rmit.edu.au


Overview:

The purpose of the assignment was to build a human model based on a subset of the MPEG-4 virtual body model, consisting of the major joints and segments in a human body. The model development was done using OpenGl and (Visual) C++. After creating an appropriate model, it had to be animated to do some basic tasks. The humanoid that was developed is an acrobat, and can mainly perform some somersaults on a trampoline.


Functionality:

The animation software developed has two humans standing on a trampoline. These can be animated separately with the help of pop-up menu choices. Each of the humans can be animated separately, or together. The animation consists of single or double somersaults. The second humanoid gives a small bow before it does its somersault. Also, trampoline is animated when the humans jump up or land on it.  There is a 'semi-interactive' animation option in which one of the models does the acrobatics while the other watches and praises the work. Users can also make the humans bow down to the audience by pressing some keyboard keys. The view points can also be manipulated from the keyboard.

The animation parameters are loaded from text files, which can be found in the 'data' folder. These files start with the number of frames at the top, followed by the parameters to be changed in various columns. They can be easily opened with spreadsheets like Excel to modify and include different animation parameters. Since the names of the files are hard-coded in the program, the file names should not change. The link to download the animation files can be found below.

Back To Top


Design:

The human model was designed with a hierarchal model. The body parts are arranged in  a tree called 'Graphics Tree' (which is a class in itself) and are made up of 'Graphics Node' object. The humanoid consists of a tree with nodes added adjacent to each other or as a child of other nodes in the tree. The Sacrum is the root node. The arrangement can be described with the figure below:

 class hierarchy

Figure1: Tree Hierarchical structure used - children appear below their parent, siblings appear to the right of the nodes

Each of the nodes have a matrix for storing its new position. Drawing the human just requires traversing through the tree and multiplying the current matrix with the node's matrix. The concept of such hierarchical tree structure allows the moving of the child nodes relative to their parent node, so that each node does not need to be positioned on some movement.

class diagram

Figure 2: Class Diagram 

At present, the GraphicsNode class can be either a cylinder or a sphere depending on the parameters specified to instantiate it. It can however have it's own color, scale, rotation and translation parameters. The GraphicsClass has a general format of a tree structure and can be easily extended to handle non-graphics node. Humanoid class has most of the parameters specifiable, so humans of different sizes can be easily created. An extension could be to read some/all of these parameters from a file. In the program, the first human is very slightly different from the second.

The two instances of humans are global and are used by the global function for animation purposes.

File Structure:

GraphicsTree.h: Header file with declaration of GraphicsTree and GraphicsNode classes.

GraphicsTree.cpp: Description of the methods for these classes.

Humanoid.h: Header file with declaration of Humanoid class

Humanoid.cpp: Contains description of the methods for Humanoid class

MainFunctions.cpp: Contains the global function for initializing and using the application.


Back To Top

Usage:

The program can be used by various keyboard and menu commands, which have been summarized below:

Menu Options: (pop-up menu attached to the right mouse button)

Menu

 Task

View Frame Type Choose rendering option - wire frame / solid
Light Turn the lighting on or off
Shade Model Choose between flat or smooth shading
Animation
Animate Human 1 Human 1 performs a double somersault - trampoline animation present
Animate Human 2 Human 2 performs a single somersault after bowing - trampoline animation present
Animate Both Humans Both do their animation together - trampoline animation present
Interactive Animation Human 1 performs a double somersault while human 2 claps and nods in admiration - trampoline animation present
Animation off Turns animation off
Reset Views Resets the eye position to (0,0,10)
Reset Humans Resets both humans to initial position which might have changed due to animation or bowing.
Exit Exit Application

Keyboard options:

Key Task
'b' Make the humans (both of them) bow down (only up to some angle)
'B' Make the humans bow up if they are bowing down
 'l' or 'L' Move the eye position towards negative x-axis
 'r' or 'R' Move the eye position towards positive x-axis
 'i' or 'I' Move the eye position towards negative z-axis
 'o' or 'O' Move the eye position towards positive z-axis
 'u' or 'U' Move the eye position towards negative y-axis
 'd' or 'D' Move the eye position towards positive y-axis
Esc Quit application

Animation files:

The animation files can be found in the 'data' folder. File used by Human 1 is "AnimationF.txt". The second human used "AnimationSec.txt" for its single somersaults and "AnimationInteractive.txt" for the interactive animation mode. The animation parameters in these files can be changed, but the file names should be retained. The data structure (columns) should also be retained and the first line in the file should indicate the number of frames to be read from the file. The files (zipped) can be found here. These files should be extracted to 'data' folder in the same directory as the program.

Compiling and running:

Unix: Provided that Glut and OpenGL is installed, the program can be compiled with the make file provided. Just type 'make' at the console. Type ./Humanoid at the console to run the compiled program.

Windows: Compile using any C++ compiler. Again, glut and OpenGl libraries must be present. The executable file is also available here, but it requires glut.dll, which can be downloaded from here. Also download the animation files from the link above.

Back To Top


Screen Shots:

The purpose of the assignment was to build a human model based on a subset of the MPEG-4 virtual body model, consisting of the major joints and segments in a human body. 

start image

Main starting view of the program

start image

   Humans in wire frame rendering

start image

  Humans drawn using flat shading model

start image

                Changing the viewport... 

start image

       Humans animating - somersaults

start image

      Humans in 'interactive' animation

start image

                  Humans bowing down

Back To Top


References:

M. Woo, J. Neider, T. Davis, D. Shreiner, 1999, OpenGL Programming Guide - The Official Guide to Learning OpenGl, Version 1.1, 2nd. Edition, Adison-Wesley, USA

Tutorials at Nehe Productions

Tutorials at Nate Robins

 

Back To Top

Valid XHTML 1.0!