materials and or textures per node

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.
Papa Lazarou
Posts: 12
Joined: Wed May 14, 2008 12:31 pm

Post by Papa Lazarou »

ok, am i right to assume the dwarf and the axe textures are applied to the saved dwarf model already, before being loaded into irrlicht?
What if i wanted to change what texture was on the dwarf and what texture was on the axe programatically?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

They're not exactly applied to the model... the model just has a list of texture coordinates and a list of textures basically. The texture coords tell the gfx card which parts of the texture should be applied to the model and where and then irrlicht uses the default textures from the file for this.

If you want to change the textures then you can change the textures themselves but keep the same names or programatically you can just change the textures that are set in the node's materials.

I suppose the dwarf's body may be material 0 and the axe may be material 1 so you could do dwarf_node->getMaterial(0).Texture = driver->getTexture("someothertexture.jpg"); ( not exactly right code, check the API for the right parameter names etc).

Your new textures though would have to be laid out in the same way as the original dwarf textures though...
Image Image Image
Papa Lazarou
Posts: 12
Joined: Wed May 14, 2008 12:31 pm

Post by Papa Lazarou »

thanks
Post Reply