The Running Man

By using forward kinematics combined with skinned skeletal animation, The Running Man shows, appropriatly enough, a running man - or swimming man, jumping man, crawling man, etc.

The models are dynamically loaded over the Internet, and are specified in the Half-Life SMD format. In this format, one file specifies a reference mesh and skeleton, while an arbitrary number of additional files provide skeletal animation data. The skeleton is specified as a simple tree, in which the position and rotation of each bone is given in the coordinate system of its parent. Therefore, rotations to upper levels in the hierarchy will automaticaly be applied to lower levels.

The mesh is originally provided as a set of triangles and vertices in world coordinates, specified as attached to a particular bone. We recursivly traverse down the tree to compute positions of the bones in the reference skeleton, by computing the appropriate transformed coordinate systems, and use the inverse of that transform to map each vertex into the local coordinate system of its attached bone.

Animation files then provide a sequence of frames, where each frame specifies the rotation of each bone. At render time, the program displays successive frames by recursivly computing the coordinate system for each bone, and then applying that transformed coordinate system to each vertex, now specified local to its particular bone. As some triangles have vertices on multiple bones, this has the effect of smoothly streching and transforming the virtual "skin" on top of the virtual "skeleton", in the same manner as our physical skin.

To rotate the object, we use a "virtual trackball" metaphor. Imagine that the object was suspended in a large sphere; when you click on the screen with the left button, the mouse grabs the appropriate location on the sphere. Moving the mouse will rotate the sphere accordingly, and the object will rotate with it. This allows for arbitrary rotations around two axes. To rotate around the vector perpindicular to the screen, hold shift + left button.

We have implemented an immediate-mode OpenGL-like interface, which allows multiple types of primitives (changed with the space bar) and performs flat-shaded lighting. Models are dynamically loaded from the Internet and parsed at run time. You can change the current model by clicking the links above.

Note that the applet only uses back-face culling for hidden surface removal (it does not perform its own rasterization, making z-buffer testing difficult) so there can be some odd effects. However, back-face testing works pretty well. To see how bad it would look otherwise press "b" to toggle back-face culling! We can also fill the polygons, but because our limited rasterizer can only perform flat shading, and the model has a low polygon count, it does not look very good.

Left Mouse Button
Rotates the object around two axes using a "virtual trackball" interface
Shift + Left Mouse Button
Rotates the object around the vector perpindicular to the screen
Center Mouse Button
Translates the object in the x-y plane
Right Mouse Button
Scales the object in the current view plane
Space Bar
Switches through the different animations
"b" Key
Toggles back face culling
"x" Key
Toggles drawing the axis lines
"s" Key
Switches between skeleton-only and skinned mode
"w" Key
Switches between wired-only and filled mode
Escape Key
Resets movement parameters

The source for Kinematics is in the files:

Copyright © 2003 Christopher DeCoro