Repeating Textures

Hey Guys! :slight_smile:



How can I put the textures to repeat in jme3? I know it on jme2, but I have no idea how to do it on this "whole new" jme. I could not locate any tutorial.



Bye! :smiley:

You can just call setWrapMode on the texture. Or do you want to do in a J3M file?

Thanks, just one question, how to set the Scale of it? Cause I'm doing like this:


Material mat = new Material(assetManager, "Common/MatDefs/Misc/SimpleTextured.j3md");
Texture floortexture = assetManager.loadTexture("Textures/texture.jpg");
floortexture.setWrap(WrapMode.Repeat);
mat.setTexture("m_ColorMap", floortexture);



and if I try to do

floortexture.setScale(new Vector3f(9, 5, 5));


it does not works :/

Yeah you cant edit the texture scale that way. You can scale the models' texture coordinates using the scaleTextureCoords method in the Mesh class.

1 Like