How to tile a texture on a quad?

Hi everyone:



I looked at the “Custom Mesh Shapes” example, and try to assign the following texture coordinates:

(0,0), (5,0), (5,5) and (0,5) around the 4 vertices, hoping to get the texture tiled 25 times. But it didn’t work.



I don’t want to create 25 quads. How to set the value GL_REPEAT? Or do I need new material file? Or I need a different approach?



Thanks!

Use the texture.setWrapMode method and set it to WrapMode.Repeat

then, set the coordinates in a 0, 1 range on your mesh.

Then use the mesh.scaleTextureCoordinates (5);

1 Like

It works! I am surprised that it is so straight forward (as it should be), if you know the approach! :slight_smile:



Thanks so much!