Different wallpaper on each face of the cube

Okay, I thought would work with BoxGeometry. In this case, you can just apply an array of materials where each material is mapped to one side of the box.

If you generate the geometry by yourself, you have to generate groups data in order to support multi-materials. The idea is to use the addGroup() method to specify what parts of the geometry should be rendered by a given material. Exemplary calls look like so:

geometry.addGroup( 0, 3, 0 );
geometry.addGroup( 3, 3, 1 );

Since you working with an indexed geometry, the first two parameters refer to indices in your case. The third parameter is the material index. The above code means the first triangle (defined by the first three indices in your index buffer) is rendered with the first material and the second triangle is rendered with the second material.

2 Likes