Skip to main content
gamedev.net
🔒 Locked

Skinned Animation

Started by Majestik666 3 replies 300+ views
Original Post
Majestik666
Majestik666
I''m trying to implement skinned animation in my engine, i export matrices and keyframes from maya using my own exporter which data seems correct but in my engine i have strange behaviours , for example it seems that rotations are done around the world origin instead of bone origin ... here is the matrix computation code in the engine : void joint::computematrix(joint * parent, matrix *orientation, matrix *forward) { localorientation = (*orientation) * (*this->WorldToJointMatrix); localinvertorientation = localorientation.invert(); this->Forward = (*forward) * *(joint->WorldToJointMatrix))) * this->anim_matrix; this->Final = (*this->Forward) * localinvertorientation; if (!(this->no_childs())) child->computematrix(this,localorientation,this->Forward); } during rendering i use the Final matrix to transform the vertices using the correct weights ... anyone has an idea ? francois
Ingenu
Ingenu
this is 100% software...

you could use hardware acceleration (Vertex Shaders are even faster, 33% on my RadeOn 8500)

I''m having the same kind of problem, getting the proper data out of the file format to get hardware acceleration working well, that''s not that easy.



-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
Majestik666
Majestik666
well for the moment i''m not really thinking about
optimisation

i try to make it work correctly ...
then i''ll think about optimisations ...
and there''s a lot to do i know ...

but .. it''s not yet working ...
Vaalegk
Vaalegk
i think that for every joint

FINAL= JointMatrix * ParentMatrix * WorldMatrix;

or

FINAL=JointMatrix * ParentMatrix

where ParentMatrix in the root joint =WorldMatrix

and in their childrens ParentMatrix corresponds to RootJoint*WorldMatrix

that is the same as in the first equation but whitout a matrix multiplication

NOTE:
This is just theory, i''m not telling you that it will work but test it and see what hapends
Majestik666
Majestik666
I really have very strange results ...
i implemented this very simple version of the matrix
computation function :

computematrix(matrix forward)
{
final = forward * worldtojointmatrix * anim_matrix;
childs->computematrix(final);
}

with this , the rendering of the joints/bones is correct
(using the translation part of the Final Matrix)

but the mesh is all fucked up ...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.