Page 1 of 1

Error with ISkinnedMesh and attach object

Posted: Sun Jul 19, 2009 4:04 am
by ledgarl
hi!,
i have a error when attach an object with a ISkinnedMesh in a jointNode.

The white object was attached to the shoulder of the character.
Sampling error for this video:
http://www.youtube.com/watch?v=6hBQP4766Cw


How can I fix this?



this is the code:

....
mesh = (ISkinnedMesh*)game->smgr->getMesh("mesh.x");
node = game->smgr->addAnimatedMeshSceneNode(mesh);
node->setJointMode(E_JOINT_UPDATE_ON_RENDER::EJUOR_CONTROL);
mesh->setInterpolationMode(E_INTERPOLATION_MODE::EIM_CONSTANT);

sl= smgr->addAnimatedMeshSceneNode(game->smgr->getMesh("sl.3ds"));
sl->setParent(node->getJointNode("Bip01_Shoulder"));
......


thanks.

Posted: Sun Jul 19, 2009 5:13 am
by Luke
seems to be with how you are updating the absolute positions of the bones, seems like you are updating them after drawing each frame, not before.

test

Posted: Mon Jul 20, 2009 3:56 am
by ledgarl
Luke wrote:seems to be with how you are updating the absolute positions of the bones, seems like you are updating them after drawing each frame, not before.


Hello,thanks for you answer!, I call the function animateJoints() before smgr->drawAll() and this improved.

but I still have an error in the end of the video when the character is tilted. The object remains in the same position despite having tilted the character. This is only updated when you call the function SetCurrentFrame but then, after that, go back to look bad, as seen in the video.

I think this happens because the function SetCurrentFrame calls a method beginTransition, which updates the bones positions. But I can not call the function SetCurrentFrame all the time because it damaged the animation
What can I do?
Thank you!