Problem of attaching weapon

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
shingoshing
Posts: 5
Joined: Tue Jan 22, 2008 5:27 am

Problem of attaching weapon

Post by shingoshing »

Hi,

I found the tutorials in this forum of attaching weapons, it works, but there is a strange problem :( : The attached object seems like blinking...

The objects are exported to .x files from .3ds using Panda Exporter. And the joint, which is the dummy helper of the biped in 3ds max, is called "LHand".

The objects are here: alien.max, alien.x, Sword.x

Code: Select all

// Load the alien mesh
IAnimatedMesh* mesh = gl_data.smgr->getMesh("./media/char/alien.x");
IAnimatedMeshSceneNode* node = gl_data.smgr->addAnimatedMeshSceneNode( mesh );

if (node)
{
	node->setMaterialFlag(EMF_LIGHTING, false);
	node->setPosition(vector3df(-70,0,-90));
	node->setMaterialTexture( 0, gl_data.driver->getTexture("./media/texture/alien.png") );

	// Attach the weapon to the hand
	ISceneNode* mPt = node->getXJointNode("LHand");
	if (mPt)
	{
		IAnimatedMesh* mesh_w = gl_data.smgr->getMesh("./media/weapon/sword.x");
		IAnimatedMeshSceneNode* node_w = gl_data.smgr->addAnimatedMeshSceneNode( mesh_w, mPt );
		node_w->setMaterialFlag(EMF_LIGHTING, false);
	}
}
I think that the problem is due to the exporter, but I'm not so sure :cry: . So do anyone know what the problem is?
Post Reply