Character Animation for Realtime Applications
Michael Putz Klaus Hufnagl
Institute of Computer GraphicsGraz University of Technology
Austria
STRUCTURE OF THIS PRESENTATION
1. introduction2. an old fashioned way of animation 3. example implementation4. outlook to a new technique5. example implementation6. diskussion
THE OLD WAY …
• low polygon alien character mesh (~1200 polys)
• main character of a freeware game „STOKEDRIDER“
• currently under developement by a group of students
• animated using keyframes and mesh interpolation (also called: vertex tweening)
LINEAR MESH INTERPOLATION
• artist models keyframes in 3D Software• export keyframes (vertex & normal positions)• runtime application generates missing
interpolation-frames
BUT NOW: let us take you where the action is..
free download at http://www.bongfish.com
CONSTRAINTS OF MESHINTERPOLATION
+ smooth animation+ folding-seams eliminated
(but only within a certain range)+ fast
- multiple copies of the mesh in memory (one for each key frame)- limit on the level of interactivity and realism - no dynamic animations at runtime
SOME STATISTICS
STOKEDRIDER filesize: 7 MBkeyframe meshes: #21
= 2.3mb ( = 32% of filesize)
only 3 tricks animations, the rest is used for ground movement ( steering, switching direction etc.. )
WHAT DO WE EXPECT FROM OUR NEXT ANIMATION-SYSTEM ?
• unlimited trick combinations for the alien rider
• response to enviromental stuff (collisions with objects, different ground conditions)
• fluid and physically correct movement
• should be a realtime implementation
• nextgen hardware should be supported (vertex shaders)
THE NEW APPROACH
2 different animation systems!
1. OFFLINE ANIMATION(exported animation using a skeletal system and softskinning)
2. ONLINE ANIMATION(realtime deformation according to ingame physics)
SKELETAL ANIMATION
• vertices bound to hierachic bonestrukture• quaternions used for „bones“
bone movement -> skin movement 1 matrix transformation -> many corresponding vertices
+ no need to store vertex positions for all the vertices for every frame of the animation
+ derive intermediate frames by using spherical interpolation+ smooth transitions while changing from one animation to
the other + the memory bandwidth is very small
- „close to joints” deformations can result in creasing
SKINNING / SOFT-SKINNING
• rigid: each vertex corresponds with only one bone -> bulges
• soft: (multiple weights)
drawback: computation overhead
))(0.1(
))(0.1(
)0.1(
3214332211
2132211
1211
WWWVWVWVWVvBlend
WWVWVWVvBlend
WVWVvBlend
OFFLINE ANIMATION
premodelled in e.g. 3dsMax, Maya, Milkshape, …• some IK physik & skeleton (like BIPED)• use envelopes to set and correct weights• generate animation-cycle (for the bones
keyframes)
exported filestructure consists of:• mesh container (lokale matritzen)• hierachichic bones (FrameTransformMatrix)• skin (texture UV-coordinates)• list of weights• animations
ONLINE ANIMATION
• „arm shake“ animation for the alien-character
• both arms should shake according to riding speed
• physics-engine generates animation parallel to offline animation
BUT HOW TO COMBINE BOTH SYSTEMS?
IMPLEMENTATION OF HANDSHAKING
• using the already existing bone-hierachy parsing code from offline animation
• wait for „shoulder bone“ than modify all bones below using sin/cos depending on riding speed
= simple but effective without almost any cpu costs
ONLINE ANIMATION
lots of other uses for physic based animation :
• Look-at constraints• Secondary motion (Chest Heaves ,breathing)• Inverse Kinematics• Muscle Bulges• Ponytails, clothes, belly etc.
OUTLOOK
• more sophisticated online animations than sin/cos
• physic-based realtime IK• using realtime terrain information => realistic
crashes• enhanced motion blending of the animations• support of multichannel precalculated
animations• complexe Offline Animation of details
QUESTIONS ?
for in-depth information about the implementation, please take a look at our paper or visit: http://www.bongfish.com/stokedrider