How to scale Texture in JME3?

I have scanned the Docs and wiki and cant seem to find something simple.

I have a floor Geometry that has a Material that has a Texture;

Im using the the code from the physics example


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

TextureKey key3 = new TextureKey(“Textures/Terrain/Pond/Pond.png”);


Texture tex3 = assetManager.loadTexture(key3);


floor_mat.setTexture(“ColorMap”, tex3);

Geometry floor_geo = new Geometry(“Floor”, floor);



floor_geo.setLocalTranslation(0, -0.1f, 0);



How do I scale the Texture? I basically want the “Pond.png” rocks to tile smaller



[java]floor.scaleTextureCoordinates(new Vector2f(3, 6));[/java]

This will draw the texture 3 times vertically and 6 times horizontally on the floor, mess with those numbers.

For me that is line 99 in the HelloPhysics,java. If you can’t find it there search for it in case it is already somewhere in your code since it was there for me by default.

Thanks adding scaleTextureCoordinates to the Mesh worked–ish.

Now I need to figure out how to make it tile.

Right now it has the smaller texture in one corner and the rest of the floor mesh has stretched lines across it

I guess my confusion is if its the Mesh, Material or the Texture that im supposed to be modifying.


To Tile Texture;

I found texture.setWrap(Texture.WrapMode.Repeat);

Isn’t that what you are doing on line 5 in your pasted code? You should have never experienced that problem with that line i think…

hi! one related question:

how can I do the same as “scaleTextureCoordinates” with a TerrainQuad ground?