i have a MD3 model but i have trouble joining each part of the body, i tried to use getMD3TagTransformation like in that topic (without modifying irrlicht source tho):
http://irrlicht.sourceforge.net/phpBB2/ ... terniontag
But it don't work, head model is not displayed, it is displayed if i remove the setposition/setrotation so i guess it is a problem with the 'getMD3TagTransformation' part, is there a way to get it working without modifying any part of the engine?
Here is the code that try to join the head to the body:
Code: Select all
scene::IAnimatedMesh* playerUpperMesh = smgr->getMesh("data/tronMd3/Models/Players/Tron/upper.md3");
scene::IAnimatedMeshSceneNode* pModelUpNode = 0;
pModelUpNode = smgr->addAnimatedMeshSceneNode(playerUpperMesh);
pModelUpNode->setPosition(core::vector3df(0,0.5f,0));
pModelUpNode->setScale(core::vector3df(0.05f,0.05f,0.05f));
pModelUpNode->setMaterialTexture(0, driver->getTexture("data/tronMd3/Models/Players/Tron/body_glow.tga"));
scene::SMD3QuaternionTag parent("");
scene::IAnimatedMesh* playerHeadMesh = smgr->getMesh("data/tronMd3/Models/Players/Tron/head.md3");
scene::IAnimatedMeshSceneNode* pModelHeadNode = 0;
pModelHeadNode = smgr->addAnimatedMeshSceneNode(playerHeadMesh, pModelUpNode);
const scene::SMD3QuaternionTag *tag_head = ((scene::IAnimatedMeshSceneNode*) playerUpperMesh)->getMD3TagTransformation("tag_head");
parent = *tag_head;
core::vector3df vScale = pModelUpNode->getScale();
parent.position *= vScale;
pModelHeadNode->setPosition(parent.position);
pModelHeadNode->setRotation(core::vector3df(parent.rotation.X*core::RADTODEG,parent.rotation.Y*core::RADTODEG,parent.rotation.Z*core::RADTODEG));
pModelHeadNode->setMaterialTexture(0, driver->getTexture("data/tronMd3/Models/Players/Tron/head_glow.tga"));