Page 1 of 1

Questions whit a single node and several meshes [SOLVED]

Posted: Sun Apr 18, 2010 3:09 pm
by oginnam
Hi, all.

I have a node with two meshes:

Code: Select all

IAnimatedMeshSceneNode* stuff;
...
...
stuff = MyScene->addAnimatedMeshSceneNode("mesh_a.x", 0, 0, vector3df(-500, 0, 50), vector3df(500, 80, 20));

stuff = MyScene->addAnimatedMeshSceneNode("mesh_b.x", 0, 1, vector3df(-500, 0, 50), vector3df(1200, 80, 20));
...
I no understand good about the addAnimatedMeshSceneNode in the parameters 2 and 3, then mi question: is possible to refer to this parameters for example, for to set to the mesh "mesh_b.x" a setMaterialFlag(video::EMF_BACK_FACE_CULLING, false), and no affect to "mesh_a.x"??... or then how i could to do this?

I have read in other posts that for optimizations for render, the better option is set several meshes in a single node, but y need set some features in some meshes and not in other, in the same node.

Excuseme for this noob question and my noob english.

Thanks.

Re: Questions whit a single node and several meshes

Posted: Sun Apr 18, 2010 3:35 pm
by Acki
oginnam wrote:I have a node with two meshes:
no, you have two nodes, but you have only one pointer where you store one of these nodes (the last created one)... :lol:

Code: Select all

stuff = MyScene->addAnimatedMeshSceneNode("mesh_a.x", 0, 0, vector3df(-500, 0, 50), vector3df(500, 80, 20));
the 1st parameter is incorect, it must be a pointer to an already loaded mesh, not the filename of the mesh...
oginnam wrote:I no understand good about the addAnimatedMeshSceneNode in the parameters 2 and 3, then mi question: is possible to refer to this parameters for example, for to set to the mesh "mesh_b.x" a setMaterialFlag(video::EMF_BACK_FACE_CULLING, false), and no affect to "mesh_a.x"??... or then how i could to do this?
yes, you can use smgr->getSceneNodeFromId(...) to get a specific node by it's ID (parameter 3 of addAnimatedMeshSceneNode)... ;)

Posted: Sun Apr 18, 2010 4:03 pm
by oginnam
Oh, yes I tried to do what you told me, and it's works.

Although i have an observation: the first parameter of addAnimatedMeshSceneNode, i see that really is the name of mesh file, or for me works thus.

thanks Acki for your quick response !! :D

Posted: Sun Apr 18, 2010 4:45 pm
by Acki
oginnam wrote:Although i have an observation: the first parameter of addAnimatedMeshSceneNode, i see that really is the name of mesh file, or for me works thus.
realy !?!?! :shock:
what Irrlicht version do you use, I can't do that with Irr1.7.1 !!! :shock: