meshes question

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Mirror
Posts: 218
Joined: Sat Dec 01, 2007 4:09 pm

meshes question

Post by Mirror »

Hi peeps! It's been a long time since I was around.

I'd like to ask something, in case anyone knows :

a) is it possible to have in the same 3d model file ( .3ds, .obj etc. ) more than one mesh ? for example having a house mesh and a car mesh.

b) if a) is possible, can i load via irrlicht each and any mesh i want, or both will be displayed once i open and load the file ?

Thank you in advance! :)
RuggJack93
Posts: 39
Joined: Mon Sep 06, 2010 5:09 pm
Location: Italy

Post by RuggJack93 »

a)
You can have as many models you want in a .3ds or .obj file as you want
(I remember that with blender I made a simple scene with a terrain, some leaves and trees then exported the scene in three files, one for the terrain, one for the trees and the leaves). So yes, it's possible to have a house and a car in the same model.

b)
When you load the model for example with smgr->addMesgSceneNode(), both the house and the car will be displayed. Unfortunately I don't know if you can choose if load the house or the car (maybe playing around with mesh buffers, but I have no idea how to do that).

However,if your intention is to load a scene using a single file and then decide what node to remove or keep, you could export the house and the car in two separate models, load them in IrrEdit, export the scene as .irr and load it in irrlicht. Then you could select the node you want to remove using:

Code: Select all

scene::IAnimatedMeshSceneNode *c=
                        smgr->getSceneNodeFromName("TheNameOfTheNodeYouPutInIrrEditYouWantToRemove");
  c->remove();
That's all.
Mirror
Posts: 218
Joined: Sat Dec 01, 2007 4:09 pm

Post by Mirror »

a) that's good ( i'm not a modeler so i don't know much about it. )

about b). No i don't want to load all scene from a file. I just want to have several meshes in a single .3ds or .obj file and load only those that I want at times. You may ask why don't i save those meshes in separate files, the answer is, because i don't want to have thousands of files for 3d models and another reason is that those meshes are topologically "close" so i don't want to read 9 files in order to display 9 meshes.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You won't succeed with a) though. Simply because these two "objects" are just parts of one object. You can move them only together, in the same direction. Would look strange to have a house moving along with the car. You can only do this with completely static scenery. Otherwise, you have to split them into separate files. But you can save them into one zip file to avoid many different files.
Mirror
Posts: 218
Joined: Sat Dec 01, 2007 4:09 pm

Post by Mirror »

oh i see, so it's still one object. that's a pitty. the idea was that i would like to break a large terrain into patches, but having a number of patches inside one .3ds file so that 1) i don't have thousands of files ( one for each patch ) and 2) don't have to access the disk each time i'd like to load some patches which are close one to the other ( a file could have 4 or 9 or 16 patches )
Post Reply