Hi,

I can't define correctly the matrixs of the bones ... 

I'm not sure but I think I would have to send the bone at the point 0, apply 
the rotaion and re-send your position ...?


Code:
osg::Quat rot = bone->getMatrixInBoneSpace().getRotate();
boneMatrices[i-1].makeIdentity();
osg::Vec3 transWorld = bone->getMatrixInSkeletonSpace().getTrans();
boneMatrices[i-1].preMultTranslate(transWorld);
boneMatrices[i-1].preMultRotate(rot);
boneMatrices[i-1].postMultTranslate(-transWorld);



in the shader...


Code:
tempPosition += weights[i] * (boneMatrices[int(matrixIndices[i])] * gl_Vertex);



I'm going crazy with the matrix...

Thank you!

Cheers,
Aitor

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28476#28476





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to