2
\$\begingroup\$

I'm sure there are articles around on this but I'm not really sure what they are called.

animation blending tends to give me the blend between two different complete animation such as walk and run.

what I'm after is having a player with that has a walk/jump animation and a firing gun animation. Is this still animation blending?

Can anybody enlighten me to how this process could be achieved?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

The process itself is rather complicated, as it involves using a lot of quaternions and matrix operations. You can't just take average of bones rotations/positions, since it would result in bizarre picture. Here's a sample code from Havok Animation component (used for blending two hkQsTransforms - universal transform class).

void hkQsTransform::setZero();
void hkQsTransform::blendAddMul(const hkQsTransform& other, hkSimdRealParameter weight = 1.0f );
void hkQsTransform::blendNormalize( hkSimdRealParameter totalWeight = 1.0f);

I believe what you want to achieve is having two animations, let's call them Move and Shoot, and being able to have player in states Move, Shoot, ShootWhileMoving. Blending of the bones will allow you to have 3 states with only 2 animations.

You might also notice, that, for example, shooting animation doesn't take legs in account - player just takes a gun and raises it, while standing still. That's what weights are for - you can just set weights on legs' bones in shooting animation to 0, and it will simplify all of the process.

As the finishing word - blending is also very useful in transition between states, for example running and standing still. It allows smooth beginning and ending, rather than characted sharply starting and stopping. Different curves can be used when transitioning, to make the transition even more smooth, or rather sharp (but still it's a transition, not complete change - at once)/

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .