Friday, April 20, 2018

c++ - Animation Blending Basics


Say I have a framework with characters that can run and walk and of course, stand still.


Am I right in thinking that animation blending is the process of smoothly transitioning between these by generating dynamic animations at runtime?


If so, what is the basic theory of how this works, and how would I implement it?



Answer



Character animation blending is more general and can be used for:



  • Computing smooth transitions between 2 clips;

  • Creating completely new animations from existing ones (potentially more than 2 at the same time);

  • Achieving IK-like behaviors;


  • etc.


The basic idea is that for two identical skeletons with different animation clips, for each joint rotation, you compute in-between values. Animation clips are represented with rotations. So linear interpolation is not what you should use if you want accurate results (even if you are using Euler angles). You can use slerp for example but more complex solutions exist.


This is a complex problem with complex solutions. Basically, if you have two animations clips A and B:



  • If A and B are completely different (blending jump and swimming), then chances are you will have strange/funny results;

  • If A and B are similar (two walking animation clips), then, you must first synchronize them to blend them when both left feet are on the ground for example.

  • etc.


If you are interested, I suggest you start by reading this article so that you can better understand what the difficulties are: http://graphics.cs.wisc.edu/Papers/2003/KG03/regCurves.pdf



It is not the most up to date one, but it is easy to read.


I hope this helps. Best regards.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...