Multiple UV maps

I am trying to figure out whether jmonkey is the right engine for me. So far I've got working - creating an object in wings3D, creating a UV map there and applying a texture in-game using that UV map.



What I've no idea yet is how to use multiple UV maps. Let's assume we have a space ship. It's got a top side and a bottom side. For each side I created a separate UV map in Wings3D, in order to in-game then apply different textures. However, there seems to be no way to specify which texture to use with which UV map. Or did I miss something?



Just setting two textures like this:



    ts.setTexture(t1);

    ts2.setTexture(t2);



will just result in the last texture being applied to both UV maps - not what I wanted to do.



Also, for some reason, after creating the UV maps in wings I have to remove their application to the selected faces by applying the default material instead. Otherwise they won't show in-game. Why is that?

No idea if this will help but try use the jme scene monitor plugin to look through your scene. Then try to access the texture state based off what object its assigned to because if your imported .obj uses multiple materials, its going to be imported as multiple objects.



heres a thread i started that is similar to what you are asking.



http://www.jmonkeyengine.com/forum/index.php?topic=13598.msg98874#msg98874

If different parts of the model use different textures, then these parts need to be in separate objects. Most model formats do not support multiple UV channels and this is not what they are for. Also you can combine the two textures into one, which is actually the better option.

Momoko_Fan said:

If different parts of the model use different textures, then these parts need to be in separate objects. Most model formats do not support multiple UV channels and this is not what they are for. Also you can combine the two textures into one, which is actually the better option.


Having different objects for the front and backside of a 3D model seems awkward. I'll have a look a the other suggestion though. Combining the textures into one is one possibility, but then one quickly ends up having gargantuan textures and somehow I suspect that the other games don't do it like this.

Thanks a lot for answering though! It is highly appreciated.