[?] Repeated textures

Hi guys!



I’m a very newbie in the jme3, so sorry for a dumb question.

How can I set a repeated texture on a geometry object?

I have such code:



[java]

Geometry geom = new Geometry(“Box”, new Box(f, x, y, z));

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

Texture texture = assetManager.loadTexture(textureName);

texture.setWrap(Texture.WrapMode.Repeat);

mat.setTexture(“m_ColorMap”, texture);

geom.setMaterial(mat);

[/java]



but I still have just a stretched texture on my box. :frowning:

What am I doing wrong?



Thanks!

use the geom.getMesh.scaleTextureCoordinates method

1 Like

Thanks!