Loading a mesh

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
xfreakk
Posts: 14
Joined: Thu Nov 15, 2007 1:58 pm

Loading a mesh

Post by xfreakk »

Hi i know theres examples for irrlicht but my questiong is very specific.
I want to load a mesh. Non Animated and certain coords x y z.
and have the mesh reload over and over again. Because the coords will be changing. This is to attach a skin to a networked player


heres my current mesh code but this isnt working

Code: Select all

scene::IAnimatedMesh* mesh = 0
	mesh = smgr->getMesh("../../../media/dwarf.x");
	scene::IAnimatedMeshSceneNode* anode = 0;

	anode = smgr->addAnimatedMeshSceneNode(mesh);
	anode->setPosition(core::vector3df(416,60,481));
	anode->setAnimationSpeed(15);

ive also tried

Code: Select all

void mesh(int x[],int y[], int z[])
{
	     video::IVideoDriver *driver;
     //ISceneNode* node;
     driver=device->getVideoDriver();
		video::SMaterial material;
	material.setTexture(0, driver->getTexture("../../../media/faerie2.bmp"));
	material.Lighting = true;

	scene::IAnimatedMeshSceneNode* node = 0;
	scene::IAnimatedMesh* faerie = smgr->getMesh("../../../media/faerie.md2");

	if (faerie)
	{
		node = smgr->addAnimatedMeshSceneNode(faerie);
		node->setPosition(core::vector3df(416,60,481));
		node->setMD2Animation(scene::EMAT_RUN);
		node->getMaterial(0) = material;

		node = smgr->addAnimatedMeshSceneNode(faerie);
		node->setPosition(core::vector3df(-70,0,-30));
		node->setMD2Animation(scene::EMAT_SALUTE);
		node->getMaterial(0) = material;

		node = smgr->addAnimatedMeshSceneNode(faerie);
		node->setPosition(core::vector3df(-70,0,-60));
		node->setMD2Animation(scene::EMAT_JUMP);
		node->getMaterial(0) = material;
	}

	material.setTexture(0, 0);
	material.Lighting = false;
}
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

You wouldn't need to reload your mesh every frame just to change its position. Just use setPosition function like you've already done.

Better idea is to set the player model or whatever as the parent of the skin. Then it's attached and moves along with the body.
Post Reply