How to set up the tiled texture on *.scene?

Hello monkeys.



I have just began implementing the simulation software for my uni project. I’m still a newbie so please bear with me. Now to my problem: the scene is a very simple polygon exported from maya. I have successfully loaded it into the engine, but I can’t seem to place a tiled texture on my scene. The texture is a simple square and as it is now it’s stretched.



This is a code I have:



[java]Node sceneModel = (Node) this.assetManager.loadModel(“Scenes/platform6/platform6.scene”);





Texture texture = assetManager.loadTexture(“Textures/grid_sampling.png”);

texture.setWrap(WrapMode.Repeat);





Material result = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);

//result.setColor(“Color”, ColorRGBA.Blue);

result.setTexture(“m_ColorMap”, texture);







sceneModel.setMaterial(result);[/java]



Is there a way to do this? Any help most appreciated it!

You need to map your textures using UV coordinates in your 3d editor.

This guide is for Blender but everything said and linked is relevant for you too.

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:external:blender

2 Likes

Thanks normen - that worked like charm!

1 Like