Hi,

I need the help of a mathematician!!
As I explained above the skeleton and the animation are loaded by BVH plugin 
... can be seen the skeleton in image ...

[Image: http://img193.imageshack.us/img193/4586/imageoir.jpg ]

I dont get descrived appropriate rotation matrix to send to the shader...


Code:
for(int i = 1; i-animList[0]->getChannels().size();i++)
{
osg::Node* boneNode = 
checkName(skelroot.get()->asGroup(),animList[0]->getChannels()[i]->getTargetName());
osgAnimation::Bone* bone = dynamic_cast-osgAnimation::Bone*-(boneNode);
osgAnimation::Bone* boneParent = 
dynamic_cast-osgAnimation::Bone*>(bone->getParent(0));

if(frames == 2)
        initBoneMatrices[i-1] = bone->getMatrixInSkeletonSpace();

boneMatrices[i-1].makeIdentity();
osg::Matrix transMatrix = bone->getMatrixInSkeletonSpace() * 
osg::Matrix::inverse(initBoneMatrices[i-1]);
osg::Quat lastRot = tempBoneMatrices[i-1].getRotate();
osg::Quat rot = bone->getMatrixInSkeletonSpace().getRotate();
osg::Quat rotWorld = rot * lastRot.inverse();
osg::Matrix rotMatrix = bone->getMatrixInSkeletonSpace() * 
osg::Matrix::inverse(tempBoneMatrices[i-1]);

boneMatrices[i-1].preMultRotate(rotMatrix.getRotate());
boneMatrices[i-1].preMultTranslate(transMatrix.getTrans());

tempBoneMatrices[i-1] = bone->getMatrixInSkeletonSpace();
}



Thank you!

Cheers,
Aitor

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





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

Reply via email to