This topic is 2106 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello

I'm implementing skeletal animations with Assimp for DX10 following this tutorial :http://ogldev.atspace.co.uk/www/tutorial38/tutorial38.html

For now, I can display the skinned mesh in global pose, filling the matrix palette with identities.

I don't understand the bone transformation explained in this tutorial, that is:

offsetMatrix*scale*rotation*translation*inverseRootNodeTransform


I think it should be :

offsetMatrix*scale*rotation*translation*inverseOffsetMatrix


1) offsetMatrix : to get from model space to bone space

2) scale*rotation*translation : transformation in bone space, get by interpoling animation keys,

3) inverseOffsetMatrix : to get back in model space.

Which one do you think is correct, please?

Thanks

[EDITED]

I tried both, and get incorrect results (abstract art instead of a ... duck )

Animation keys interpolation seems to work, but I wrongly compute the bone transformations apparently.

I suppose I don't understand correctly the aim of the offset matrix ...

[EDITED2] fixed !

in fact the transformation for a node is :

scale*rotation*translation*parent


and is for a bone :

offset*scale*rotation*translation*parent*inverseRoot


[EDIT3]

In this tutorial it has been said :

If the node does not correspond to a bone then that is its final transformation. If it does we overwrite it with a matrix that we generate.

Actually it's not totally true, if an animation channel is associated to a node, we must also overrite the transform with animated one, even if it is not associated to a bone.

(Anyway, it would be odd that some animations channels would be defined for nothing ....)

Edited by Tournicoti

##### Share on other sites

Hi,

I'm implementing the same skeletal animations with Assimp for DX11 but my is result is bad...

And i need some help...

void Mesh::ReadNodeHeirarchy(float AnimationTime, const aiNode* pNode, XMMATRIX ParentTransform)

{
String NodeName(pNode->mName.data);

const aiAnimation* pAnimation = m_pScene->mAnimations[0];

aiMatrix4x4 mat = pNode->mTransformation;
XMMATRIX NodeTransformation = TOXMMATRIX(mat);

const aiNodeAnim* pNodeAnim = FindNodeAnim(pAnimation, NodeName);

if (pNodeAnim) {
// Interpolate scaling and generate scaling transformation matrix
aiVector3D Scaling;
CalcInterpolatedScaling(Scaling, AnimationTime, pNodeAnim);
XMMATRIX ScalingM =XMMatrixScaling(Scaling.x, Scaling.y, Scaling.z);

// Interpolate rotation and generate rotation transformation matrix
aiQuaternion RotationQ;
CalcInterpolatedRotation(RotationQ, AnimationTime, pNodeAnim);

XMVECTOR axis = XMVectorSet(RotationQ.x,RotationQ.y,RotationQ.z,1);
XMMATRIX RotationM = XMMatrixRotationQuaternion(XMQuaternionRotationAxis(axis,RotationQ.w));
//RotationM = XMMatrixTranspose(RotationM);

// Interpolate translation and generate translation transformation matrix
aiVector3D Translation;
CalcInterpolatedPosition(Translation, AnimationTime, pNodeAnim);
XMMATRIX TranslationM = XMMatrixTranslation(Translation.x, Translation.y, Translation.z);

// Combine the above transformations
NodeTransformation = ScalingM *  RotationM * TranslationM ;

}

XMMATRIX nodeTrans =  NodeTransformation * ParentTransform;

if (m_BoneMapping.find(NodeName) != m_BoneMapping.end()) {
unsigned int BoneIndex = m_BoneMapping[NodeName];
m_BoneInfo[BoneIndex].FinalTransformation =  m_BoneInfo[BoneIndex].BoneOffset * nodeTrans * m_GlobalInverseTransform ;

// m_GlobalInverseTransform *  *  GlobalTransformation      ;
}

for (unsigned int i = 0 ; i < pNode->mNumChildren ; i++) {
}
}

Can you help me ?

Thanks,

Fabrice

##### Share on other sites

Hello

I've implemented skeletal animations in two phases : GPU side and CPU side.

1)I coded the shaders that do skinning, and checked them via offset matrices set to identity, to check if I display in this case the bind pose correctly.

2)Then I coded the animation controller, I had some difficulties at the begining but finally I get it work with the transformations I give for bones or for nodes in the first post.

Did you check the first point ? Do you get the bind pose with identity offset matrices ?

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 9
• 15
• 9
• 11