Page 1 of 1
Export 2 objects with 2 textures ?
Posted: Sun Sep 18, 2005 12:22 pm
by AndersNyman
Hi
I have just started to experiment with the Ogre engine. Now I have faced a big problem. I hope someone can help me!
Ok.
I have built a character in Maya. The character has two parts, Head and Body. They use two different bitmap textures. When I select both parts and export them, it looks like this in my application:
It looks like the vertexes that belong to the head have been placed all over the body.
Posted: Sun Sep 18, 2005 12:48 pm
by haffax
It more look like the head texture is used on the body mesh.
Anyway, export Body and Head as one Mesh (I don't know Maya, but I guess it has some function to join two object to one or such). The exporter should take care of correct submesh creation. For each material you use in an object in maya, one submesh with the correct material/texture is created.
Posted: Sun Sep 18, 2005 1:07 pm
by AndersNyman
hmm, but i can“t use 2 shaders on one mesh. right?
anyway... do i have to use any flags in the code to use sub entities?
Posted: Sun Sep 18, 2005 2:55 pm
by P
a look to
http://www.ogre3d.org/docs/manual/manual_16.html#SEC25 will help you to understand how are working .material scripts.
You can access submeshes from mesh using Ogre::Mesh::getSubMesh or using the iterator given by Ogre::Mesh::getSubMeshIterator and then set the material name of each submesh with Submesh:setMaterialName
Ogre::Mesh :
http://www.ogre3d.org/docs/api/html/cla ... 1Mesh.html
Ogre::Submesh :
http://www.ogre3d.org/docs/api/html/cla ... bMesh.html
But it's not necessary to do that with code, you can have the same result with exporting the single mesh with its 2 submeshes like Haffax said.
And, if your mesh is exported as 2 submeshes with the Maya exporter, you have to do nothing more than loading it.