Questions whit a single node and several meshes [SOLVED]

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
oginnam
Posts: 7
Joined: Mon Dec 14, 2009 4:20 pm
Location: Colombia

Questions whit a single node and several meshes [SOLVED]

Post 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.
Last edited by oginnam on Sun Apr 18, 2010 4:04 pm, edited 1 time in total.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: Questions whit a single node and several meshes

Post 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)... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
oginnam
Posts: 7
Joined: Mon Dec 14, 2009 4:20 pm
Location: Colombia

Post 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
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply