Best way to load several meshes?

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
Il_Pax
Posts: 7
Joined: Wed Feb 16, 2005 6:53 pm

Best way to load several meshes?

Post by Il_Pax »

Hi, i have started out what hopefully will be my town. I have some houses, their textures and lightmaps. Successfully imported one of my houses and assigned collision to it. (based on the collision tutorial)

Do the following for each of my objetcs in order to make it work correctly?:

scene::IAnimatedMesh *mesh = smgr->getMesh("media/house1.obj");
scene::ISceneNode *node (0);
if (node) {
node->SetMaterialFlag(EMF_LIGHTING, false);
node ->setMAterialTexture (0, driver->getTexture ("media/house1.tga")); }
node->SetMaterialFlag(EMF_FOG, true); // i want fog on my scene

if (node){
selector= smgr ->createOctTreeTriangleSelector(
mesh ->getMesh(), node, 128);
node->setTriangleSelector(selector);
selectpor->(drop)
}

is there an alternative to it? where can i see a sample of loading different meshes (ok, collision tutorial has 3 faeries, but it seems they are instances of the one pointed out by faerie). I thought on making a class for all of my data, however just don't know how to implement it (class buildings which would contain collision and fog states). Still trying to learn c++

Sorry for so many newbie questions, i'm more on the art side of the pond. Thanks.
wolfsb
Posts: 26
Joined: Sun Dec 26, 2004 1:51 pm
Location: Berlin, Germany

Post by wolfsb »

If you not just typed this piece of source code but pasted and copied it from original file, then you might run into a few problems:

should be : SetMaterialTexture -> instead of SetMAterialTexture
should be : selector -> instead of selectpor
should be : EMF_FOG_ENABLE -> instead of EMF_FOG
Il_Pax
Posts: 7
Joined: Wed Feb 16, 2005 6:53 pm

Post by Il_Pax »

Yes wolfsb, you're right, i have lots of typos (happily enough code is running ok, as it is on another machine, wo. these mistakes).

Yesterday i played a lot and found a nice pipeline for my stuff, here it goes:

- Once my model is done, lightmap it and bake my texture AND the lightmap into the same object.
- Place everyhouse in their own position, in my 3d app, set neutral pose
- Export each one as an .obj
- Load into Ultimate Unwrap, each house has now its own place (as defined in 3d app)
- Export as .x
- Reopen and resave in mview

And that's pretty much it !

I hope this lines might help some other newbies. If anyone else has a pipeline that would like to share, please let me know.

Now i better i get to do some work, thanks for reading.
Post Reply