Page 1 of 1

Two textures

Posted: Mon Jan 30, 2012 9:19 pm
by bdpdonp
I read the forums on this and I honestly did ot understand. Guess I am still a beginner after a few months.

I have two bitmaps to a 3ds file. The code I use loads the model fine, but only seems to work with one texture and I have 2 of them. So far, cannot figure out how.

Code: Select all

        playerModel = smgr->getMesh("Models\\warbird.ms3d");
        node = smgr->addMeshSceneNode(playerModel);
        if (node) {
                node->setMaterialFlag(video::EMF_LIGHTING, false);
                node->setMaterialTexture(0, driver->getTexture("Models\\warbird.bmp"));
        } 

Re: Two textures

Posted: Mon Jan 30, 2012 10:16 pm
by Iyad
set texture layer to 1 for the second texture.
or merge both textures in 1 image and recalculate UV for the model.

Re: Two textures

Posted: Mon Jan 30, 2012 10:30 pm
by hybrid
No, don't give too much on these tipps. For two textures you should have two materials in the mesh (or more). You have to get the materials and set the first texture of each to the proper textures. If your model does not have these textures, though, you might find only one meshbuffer. In that case you could use the second approach from Iyad. But since you'd have to rework your model anyway, it would be much better to assign two different materials in the mesh editor, and then use my first approach.