[LIBGDX] skinning a cube with multiple textures

Hi everyone,

i have created a ModelInstance in libgdx with


cube = new ModelBuilder().createBox(block_size, block_size/2, block_size,
		        new Material(), Usage.Position | Usage.Normal | Usage.TextureCoordinates);

instance = new ModelInstance(cube, 0, 0, 0);

and now i want to skin the 6 sides of this cube with different textures.
when i set a texture with


instance.materials.get(0).set(TextureAttribute.createDiffuse(texture));

all six sides have this texture streched to the size of each rectangle.
this lets me suppose, there is a way, to set a texture for each side

http://s1.postimg.org/5br36hywf/screen.png

http://s27.postimg.org/fswbjw44v/grasssmile.png

i have searched the net for a few hours now and nowhere i can find something with multiple textures

my regards!

Could we get a full view of your code?

Hello Community,

I have this same problem as the OP. Does anyone have an idea how it could be done?

I have tried this by creating a textured mesh in Blender. In Blender I have mapped the texture and then exported it to LibGDX. This works, no problem. But I would like to dynamically assign the texture (maybe different ones) to each side. Importing the model is to my understanding static.

As an alternative I have also created a quad to which I can put a texture. This works too but obviously I am missing 5 sides of the mesh.

  1. I probably can create the missing 5 sides (as quads) and have them skinned, but is this really the only option?
  2. Can I skin a mesh created by modelBuilder.createBox somehow?
  3. Any other or better alternatives for doing this?

Thanks you in advance!

Cheers, Jaxes

WordSlinger- The best word game if developer opinion counts.
https://play.google.com/store/apps/details?id=com.method.wordslinger