Loading more than one 3d 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
Tathagatha

Loading more than one 3d mesh

Post by Tathagatha »

Is it possible to load more than one 3d mesh at a time? In the same file?
If so, can they be animated meshes? I have followed the tutorials, yet none of them show if this is either possible or impossible.
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

I don't understand your problem whatsoever, a file is one mesh. Just because you split you mesh in your modelling program, all you actually have created is a sub-mesh. Irrlicht doesn't distinguish between sub-meshes.
Tathagatha

Post by Tathagatha »

What I mean is this: I have one 3d mesh which I want to import and assign a translucent texture, meanwhile I have another mesh I would like to load that does not have a special material assigned within Irrlicht, online the maps exported from the modeling software. Or in another example, I would like to model a animated mesh on one hand and the rest of the scene separatly. Can this be done?
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

I still don't understand your problem. I'm guessing English isn't your first language, which could be why I don't understand you. Could also be the terminology you are using. I'll try and make out your first example:
I have one 3d mesh which I want to import and assign a translucent texture, meanwhile I have another mesh I would like to load that does not have a special material assigned within Irrlicht, online the maps exported from the modeling software
You want to load one mesh and assign a material to it and load the same mesh again but without this material? You can't assign materials from a modelling program to the mesh ( i.e. transparency ) so I am assuming you are talking about assigning the transparency value to the mesh inside Irrlicht. Since you create the mesh in it's own scene node you can have as many scene nodes that load from the same file as you want and assign different materials to them seperatly.

I get the feeling that this may not be what you are talking about but that's as close as what you have said there as I can get.
LordNaikon
Posts: 164
Joined: Wed May 05, 2004 5:34 pm
Location: Germany Berlin
Contact:

Post by LordNaikon »

I would like to model a animated mesh on one hand and the rest of the scene separatly. Can this be done?
do you try to load your model, your map , your terrain with only one scene node? and now you have the problem it does not function? it only funktion with one scene node and one model? and now you want to know how to load other models than only one? or you have build a model within a map you load it and now you want to animate the model but it doesn't?
q|^.^|p beeing every time friendly to everyone
sys: 2500+Barton 512MB 6600GT WinXP
Tathagatha

Post by Tathagatha »

Do to a few serious typos, my inexperience with the engine (and to be frank, my limited experience in programming in general :( ) I have not been able to express my concerns inh a clear and conscise manner. But your reply's have been extremely helpfull to focus my question:
Is it possible to create multiple scene nodes? Each one loading a separate 3d mash?
For example: let's say I have box.3ds and sphere.3ds, and I want to load them both on the same .exe, so that when you load the progam boxandsphere.exe you see a box and a sphere. I want to do this in order to assign a transparent material to the whole scene node that loads sphere.3ds.
I hope I have explained myself, thank you all for your invaluable help.
Tathagatha

Post by Tathagatha »

Do to a few serious typos, my inexperience with the engine (and to be frank, my limited experience in programming in general :( ) I have not been able to express my concerns in a clear and conscise manner. But your reply's have been extremely helpfull to focus my question:

Is it possible to create multiple scene nodes? Each one loading a separate 3d mesh?

For example: let's say I have "box.3ds" and "sphere.3ds", and I want to load them both on the same .exe, so that when you load the progam "boxandsphere.exe" you see a box and a sphere. I want to do this in order to assign a transparent material to the whole scene node that loads "sphere.3ds". Is this at all possible?
I hope I have explained myself, thank you all for your invaluable help.
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Ahh, that simple :) Yes, that is why the engine uses scene nodes. What you do is define the scene nodes like this:

irr::scene::ISceneNode* box;
irr::scene::ISceneNode* sphere;

Then add your models using this:

box = smgr->getMesh("box.3ds");
sphere = smgr->getMesh("sphere.3ds");

box->setPosition(core::vector3df(0,0,0));
sphere->setPosition(core::vector3df(1,0,0));
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

What Tyn? Did you skip a step? ISceneManager::getMesh returns an IAnimatedMesh*, not a scene node pointer.

Do
IAnimatedMesh* boxmesh=smgr->getMesh("box.3ds");
IAnimatedMesh* spheremesh=smgr->getMesh("sphere.3ds");
ISceneNode* box=smgr->addAnimatedMeshSceneNode(boxmesh);
ISceneNode* sphere=smgr->addAnimatedMeshSceneNode(spheremesh);

unless i messed something up :wink:
Post Reply