Q: Map texture to cube stretched over the entire surface in java? I'm trying to map a texture to a cube in M3G (mobile 3d api J2me), but it's getting repeated instead of streching over the entire face of a cube. I'm getting two repeated texture per face of the cube but I want just a single texture mapped per face.
Here is the relevant code:
  private static final byte[] VERTEX_POSITIONS = {
   -1, -1,  1,    1, -1,  1,   -1,  1,  1,    1,  1,  1, // front
    1, -1, 0,   -1, -1, 0,    1,  1, 0,   -1,  1, 0, // back
    1, -1,  1,    1, -1, 0,    1,  1,  1,    1,  1, 0, // right
   -1, -1, 0,   -1, -1,  1,   -1,  1, 0,   -1,  1,  1, // left

   -1,  1,  1,    1,  1,  1,   -1,  1, 0,    1,  1, 0, // top
   -1, -1, 0,    1, -1, 0,   -1, -1,  1,    1, -1,  1  // bottom
 };

 private static final int[] TRIANGLE_INDICES = {
    0,  1,  2,  3,   // front
    4,  5,  6,  7,   // back
    8,  9, 10, 11,   // right
   12, 13, 14, 15,   // left
   16, 17, 18, 19,   // top
   20, 21, 22, 23,   // bottom
 };


 private static int[] TRIANGLE_LENGTHS = {
   4, 4, 4, 4, 4, 4
 };

 private static final byte[] VERTEX_TEXTURE_COORDINATES = {
   0, 1,   1, 1,   0, 0,   1, 0,   // front
   0, 1,   1, 1,   0, 0,   1, 0,   // back
   0, 1,   1, 1,   0, 0,   1, 0,   // right
   0, 1,   1, 1,   0, 0,   1, 0,   // left
   0, 1,   1, 1,   0, 0,   1, 0,   // top
   0, 1,   1, 1,   0, 0,   1, 0,   // bottom
 };

