Page 1 of 1

Meshes

Posted: Sat Apr 25, 2009 1:06 pm
by overburn
If i have a mesh with multiple submeshes (layers in max) , can i assign a separate texture for each submesh? And how? :)
Thanks

Posted: Sat Apr 25, 2009 2:08 pm
by arras
In Irrlicht terms mesh can not have several submeshes (there is animated mesh but thats not what you want probably).

Mesh however have one or more meshbuffers. Meshbuffer is where geometry (vertices, normals, UVs) and material (texture, color, lighting) are stored.

You can assign different texture to different meshbuffers.

Posted: Sat Apr 25, 2009 2:40 pm
by overburn
ok so - if anyone knows. when i export a multilayered model from 3d studio max , it exports the layers as independent meshes or as meshbuffers?

Posted: Sat Apr 25, 2009 3:24 pm
by Adler1337
i think your'e making this more complicated than it actually is. All you have to do is select the faces or meshes and apply a material to them and then apply a texture to that material(in 3d studio). Since I don't think irrlicht transfers textures with the object, all you should have to do is apply the textures to the materials in irrlicht (or irredit a lot easier, no code)

Posted: Sat Apr 25, 2009 4:53 pm
by overburn
ok :) thanks.
and another thing -
say i have a door that's part of the building, but it's a separate layer. and i want to be able to open that door. how should i go about it (procedurally in irrlicht or?) ? :) thanks

Posted: Sat Apr 25, 2009 6:30 pm
by hybrid
If you want to animate parts of a mesh you have to go via animated meshes. 3ds animations are not supported, so your best try is to go the skeletal animation way, e.g. via b3d. Create and attach a bone to the door and you can easily animated the door via the joint.

Posted: Mon Apr 27, 2009 6:38 pm
by arras
Well its not the best advice in this case.
It will work fine if you have one door ...Once you want some more you are in trouble. You would need many many animations to cower all posible scenarios of door opening: One door opens, second opens, both open, one opens while second is closed, then it opens while second is opened already... and so on.

Rather animate door on its own. Made it independent object or at last meshbuffer and animate it in code. Its not that hard to code object rotating few degrees you need. Or you can use it animated but then it must be independent node.