So, i made it like this:
public class TextureBox extends Object3D{
int size = 1;
public TextureBox(int size){
super(size);
SimpleVector upperLeftFront=new SimpleVector(-size,-size,-size);
SimpleVector upperRightFront=new SimpleVector(size,-size,-size);
SimpleVector lowerLeftFront=new SimpleVector(-size,size,-size);
SimpleVector lowerRightFront=new SimpleVector(size,size,-size);
SimpleVector upperLeftBack = new SimpleVector( -size, -size, size);
SimpleVector upperRightBack = new SimpleVector(size, -size, size);
SimpleVector lowerLeftBack = new SimpleVector( -size, size, size);
SimpleVector lowerRightBack = new SimpleVector(size, size, size);
// Front
this.addTriangle(upperLeftFront,0,0, lowerLeftFront,0,size, upperRightFront,size,0);
this.addTriangle(upperRightFront,size,0, lowerLeftFront,0,size, lowerRightFront,size,size);
// Back
this.addTriangle(upperLeftBack,0,0, upperRightBack,size,0, lowerLeftBack,0,size);
this.addTriangle(upperRightBack,size,0, lowerRightBack,size,size, lowerLeftBack,0,size);
// Upper
this.addTriangle(upperLeftBack,0,0, upperLeftFront,0,size, upperRightBack,size,0);
this.addTriangle(upperRightBack,size,0, upperLeftFront,0,size, upperRightFront,size,size);
// Lower
this.addTriangle(lowerLeftBack,0,0, lowerRightBack,size,0, lowerLeftFront,0,size);
this.addTriangle(lowerRightBack,size,0, lowerRightFront,size,size, lowerLeftFront,0,size);
// Left
this.addTriangle(upperLeftFront,0,0, upperLeftBack,size,0, lowerLeftFront,0,size);
this.addTriangle(upperLeftBack,size,0, lowerLeftBack,size,size, lowerLeftFront,0,size);
// Right
this.addTriangle(upperRightFront,0,0, lowerRightFront,0,size, upperRightBack,size,0);
this.addTriangle(upperRightBack,size,0, lowerRightFront, 0,size, lowerRightBack,size,size);
this.build();
}
}
But when i'm use it like this:
cube = new TextureBox( 12);
cube.setTexture("texture");
I see 12x12 textures per face, and i cant understand why...
What should i do for see 1 texture per 1 face?