Error with ISkinnedMesh and attach object

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
ledgarl
Posts: 30
Joined: Wed Oct 25, 2006 1:58 pm
Location: Bogota,Colombia

Error with ISkinnedMesh and attach object

Post 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.
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post 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.
[url=irc://irc.freenode.net/irrlicht]irrlicht irc[/url] - corrodinggames.com
ledgarl
Posts: 30
Joined: Wed Oct 25, 2006 1:58 pm
Location: Bogota,Colombia

test

Post 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!
Post Reply