Box has same Texture on every side. How can I change the wrapping?

I want to put a dice texture on a box like the one the Simple Application has by default. The Problem is, the whole texture is shown on every side of the dice, instead of wrapping around the geometry.

There seems to be no way to do this in the material settings. I´ve found the method setWrap, but don´t know if this can solve my problem.

Thanks in advance!

You have to change the texture coordinates of the sides of the box to match the area of the texture that you want to show.

Okay, then I will try to add the texture manually and then fiddle with the texture coordinates. Thank you for the fast reply!

Just make your own cube in blender and UV unwrap it. It should be much faster and easier.

Seems I still don´t understand. How do I change the texture coordinates of the sides of the box? I found nothing on this topic.

Good idea, but I want to know how to manipulate textures this way, because it will helpme on other problems too.

Read about custom meshes. How you’d set the texture coordinates on a custom mesh is the same way you’d set it on a Box. There is no magic method that does the work for you so eventually you’ll have to look at the source code and see how it sets its texture coordinates.

Then just call that same method on your box and give it different values.

…however, for interpreting the code you are definitely going to want to know how meshes are constructed and there is a tutorial for that.

Thank you! That is a good point to start from!