Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17063

Blending skeletal animations question

$
0
0

Hi, I'm working on blending skeletal animations in my project. And I finally got confused in my own code...

I have 2 arrays of glm::mat4, which represents lhs and rhs animation's bones. So, I need to blend these 2 arrays of bones in the third one.

In the very beginning I wrote next naive approach:

inline mat4 blendBones(const mat4 &lhs, const mat4 &rhs, const float factor) {
    quat lhsQuat = quat_cast(lhs);
    quat rhsQuat = quat_cast(rhs);
    quat finalQuat = slerp(lhsQuat, rhsQuat, factor);

    vec4 lhsTransform  = lhs[3];
    vec4 rhsTransform = rhs[3];
    vec4 finalTransform = mix(lhsTransform, rhsTransform, factor …

Viewing all articles
Browse latest Browse all 17063

Trending Articles