Page 1 of 1

Best way to load several meshes?

Posted: Wed Feb 23, 2005 4:47 am
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.

Posted: Wed Feb 23, 2005 8:38 am
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

Posted: Wed Feb 23, 2005 3:26 pm
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.