Box with multiple textures

Another noob question :slight_smile:

how can I set different textures for a box … imagine a dice … each side must have a different texture.



you need to create your own texture, and proper uv mapping of the cube.

like that for example.

Thx. Is there a required size of such a texture (pow of 2?), max dimension, color depth etc.?

Your image shows the texture for a dice … what is the “general” approach to map texture-areas to mesh-areas?

The texture should be power of two and best not bigger than 2048x2048 as “high quality”. The mapping is done via the texture coordinates of each vertex. Other sizes may work on some cards, but many produce errors with non-pow2 images.

The mapping is done via the texture coordinates of each vertex.

That meens? Is this anything that I must do "by hand" (in javacode)?

This is something you need to do in a modeling editor like blender, maya or 3DS max.

There are plenty of tutorials on the internet to learn creating uv mappings with those tools.

Ok. I define the mapping between my texture and a “standard” jme-box (1,1,1) in such programms and then in jme

I create a Box(1,1,1) + a Geometry and load these Texture to the Geo. Right? I will try it :smiley:

no, you create a box in your editor, and generate mapping coordinates for it, then you import it into JME with the ogre xml importer.

look at this doc

1 Like