Jme3 - UV map inappropriate for model exported from Blender

In Blender 2.69, I created a simple barrel model (.zip) . Then I created a UV map in Blender and made a UV map of the texture from it (also in the archive). Then I imported my texture into Blender, now the correspondence matches:

The mapping

In Blender, the model looks great:

Model in Blender

Using the Ogre exporter plugin that I installed via the jmonkeyengine SDK, I exported the model. The result of this is my OgreXML file format for the trunk (I did not export the material).

Now I tried to add a barrel to my world as follows:

this.barrel = this.assetManager.loadModel("models/barrel/Barrel.mesh.xml");

Material barrelMat = new Material(this.assetManager,
        "Common/MatDefs/Light/Lighting.j3md");
barrelMat.setTexture("DiffuseMap",
        this.assetManager.loadTexture("models/barrel/Barrel.jpg"));
barrelMat.setBoolean("UseMaterialColors", true);
barrelMat.setColor("Diffuse", ColorRGBA.White);
barrelMat.setColor("Specular", new ColorRGBA(0.3f, 0.1f, 0, 1));
barrelMat.setFloat("Shininess", 4f);
this.barrel.setMaterial(barrelMat);

this.rootNode.attachChild(this.barrel);

The result is the following:

The failed barrel image

Is there anything else I need to consider when setting up the texture for my model with UV display?

+3
1

Blender JME . :

barrelMat.setTexture("DiffuseMap", 
                     assetManager.loadTexture("models/barrel/Barrel.jpg"));

TextureKey- loadTexture() yFlip false, true .

assetManager.loadTexture(new TextureKey("models/barrel/Barrel.jpg", false));

.

:

loadTexture(): http://hub.jmonkeyengine.org/javadoc/com/jme3/asset/AssetManager.html#loadTexture(com.jme3.asset.TextureKey)

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

+2

All Articles