UV mapping problem in Blender exported model

Hey guys!

At first I’d like to say hello, my name is Max, I’m a software developer and I’m new to jMonkeyEngine.
I have a problem with a model I exported from Blender. I already asked this question on StackOverflow here: java - jme3 - UV map misplaced on model exported from Blender - Stack Overflow

Does anyone have an idea what is wrong?

Thanks in advance! :slight_smile:

2 Likes

barrelMat.setTexture(“DiffuseMap”,
this.assetManager.loadTexture(“models/barrel/Barrel.jpg”));

…instead you need to y-flip the texture.

Use this version of the loadTexture() method and give it a TextureKey with the same jpg but with y-flip set to true:
http://hub.jmonkeyengine.org/javadoc/com/jme3/asset/AssetManager.html#loadTexture(com.jme3.asset.TextureKey)

1 Like

http://hub.jmonkeyengine.org/javadoc/com/jme3/asset/TextureKey.html#TextureKey(java.lang.String,%20boolean)

By the way, your stack overflow question was perfect. Had every bit of information we needed to answer your question. So nice. :slight_smile:

1 Like
@pspeed said: By the way, your stack overflow question was perfect. Had every bit of information we needed to answer your question. So nice. :)

agreed, we need more like this. Short but packed full of relevant information, rather than: “it don’t work, help me! I tried 3 days no success :(”

Hey PSpeed, thanks a lot, I’ll try this when I get home. I already thought it could be something like this, but I couldnt figure it out. Haha, thank you, better questions always generate better answers. :slight_smile:

1 Like
@maxdev said: Hey PSpeed, thanks a lot, I'll try this when I get home. I already thought it could be something like this, but I couldnt figure it out. Haha, thank you, better questions always generate better answers. :)

Indeed.

Well, I tried this just now, but: I have to set the yFlip to “false” instead of true to make it work (???). Is the default value for this true or false? Or may it be that information about this is already stored in the OgreXML file?

In the TextureKey constructor, the default for flipY is true.

1 Like

Ooops. My bad. A case where the total lack of javadoc on this class hobbled me. :slight_smile:

I’ve corrected the answer on stack overflow also.

1 Like