MD3: Troubles to join parts

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Grz-
Posts: 62
Joined: Wed Dec 26, 2007 1:06 pm

MD3: Troubles to join parts

Post by Grz- »

Hi,

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"));
captainkitteh
Posts: 28
Joined: Sat May 21, 2011 10:49 am
Location: Dhaka, Bangladesh
Contact:

Post by captainkitteh »

Not to criticise you but why are you using MD3 when you can achieve same results with an easier approach ? Using B3D gives almost same degree of freedom but with much less hassle.
Insert witty saying
Grz-
Posts: 62
Joined: Wed Dec 26, 2007 1:06 pm

Post by Grz- »

Because it is easier to get a good range of free ready to use animated characters models with it, i am not skilled enough for modelling&animating.
captainkitteh
Posts: 28
Joined: Sat May 21, 2011 10:49 am
Location: Dhaka, Bangladesh
Contact:

Post by captainkitteh »

I understand. I once thought the same and went for md2.

Then I found a better solution. Modelling is hard, texturing is hard. But animating is not. If you have a textured model making a skeleton and doing a simple walk animation can be as easy as a 20 minute task. Even for a novice like me.

Personally, I simple get a free model, load in milkshape, put a skeleton, make the animation and export to b3d. It saved me ages of time and lets m

It certainly beats figuring out ins and outs of MD3 format.
Insert witty saying
Grz-
Posts: 62
Joined: Wed Dec 26, 2007 1:06 pm

Post by Grz- »

Anyone know the problem?

As for b3d i will check it out but that would be nice to have an answer for MD3 as i could use it later and it could help others peoples with the same problem as well.
Post Reply