Thanks for the quick answer. Your suggestion worked fine for creating the cube. I generalized it so that it can use any x1,x2,y1,y2,z1,z2 and paste the 6 images onto the faces. I also am using buffered images so that I can print onto the sides of the cubes. I haven't started with the transformations yet, but I am looking forward to playing with them. I had a lot of fun with Java2D's transform system.
void createBox() {
texture[0] = new Texture(image[0].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t0", texture[0]);
texture[1] = new Texture(image[1].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t1", texture[1]);
texture[2] = new Texture(image[2].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t2", texture[2]);
texture[3] = new Texture(image[3].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t3", texture[3]);
texture[4] = new Texture(image[4].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t4", texture[4]);
texture[5] = new Texture(image[5].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t5", texture[5]);
box = new Object3D(12);
SimpleVector upperLeftFront = new SimpleVector(locationActual.x1, locationActual.y1, locationActual.z1);
SimpleVector upperRightFront = new SimpleVector(locationActual.x2, locationActual.y1, locationActual.z1);
SimpleVector lowerLeftFront = new SimpleVector(locationActual.x1, locationActual.y2, locationActual.z1);
SimpleVector lowerRightFront = new SimpleVector(locationActual.x2, locationActual.y2, locationActual.z1);
SimpleVector upperLeftBack = new SimpleVector(locationActual.x1, locationActual.y1, locationActual.z2);
SimpleVector upperRightBack = new SimpleVector(locationActual.x2, locationActual.y1, locationActual.z2);
SimpleVector lowerLeftBack = new SimpleVector(locationActual.x1, locationActual.y2, locationActual.z2);
SimpleVector lowerRightBack = new SimpleVector(locationActual.x2, locationActual.y2, locationActual.z2);
TextureManager tm = TextureManager.getInstance();
// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1, upperRightFront, 1, 0, tm.getTextureID(debugName + "t1"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1, lowerRightFront, 1, 1, tm.getTextureID(debugName + "t1"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0, lowerLeftBack, 0, 1, tm.getTextureID(debugName + "t0"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1, lowerLeftBack, 0, 1, tm.getTextureID(debugName + "t0"));
// Upper
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1, upperRightBack, 1, 0, tm.getTextureID(debugName + "t4"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1, upperRightFront, 1, 1, tm.getTextureID(debugName + "t4"));
// box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1, upperRightBack, 1, 0);
// box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1, upperRightFront, 1, 1);
// Lower
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0, lowerLeftFront, 0, 1, tm.getTextureID(debugName + "t3"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1, lowerLeftFront, 0, 1, tm.getTextureID(debugName + "t3"));
// Left
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0, lowerLeftFront, 0, 1, tm.getTextureID(debugName + "t2"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1, lowerLeftFront, 0, 1, tm.getTextureID(debugName + "t2"));
// Right
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1, upperRightBack, 1, 0, tm.getTextureID(debugName + "t5"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1, lowerRightBack, 1, 1, tm.getTextureID(debugName + "t5"));
box.setTexture("dfg");
box.build();
}
void createBox() {
texture[0] = new Texture(image[0].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t0", texture[0]);
texture[1] = new Texture(image[1].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t1", texture[1]);
texture[2] = new Texture(image[2].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t2", texture[2]);
texture[3] = new Texture(image[3].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t3", texture[3]);
texture[4] = new Texture(image[4].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t4", texture[4]);
texture[5] = new Texture(image[5].bufferedImage);
TextureManager.getInstance().addTexture(debugName + "t5", texture[5]);
box = new Object3D(12);
SimpleVector upperLeftFront = new SimpleVector(locationActual.x1, locationActual.y1, locationActual.z1);
SimpleVector upperRightFront = new SimpleVector(locationActual.x2, locationActual.y1, locationActual.z1);
SimpleVector lowerLeftFront = new SimpleVector(locationActual.x1, locationActual.y2, locationActual.z1);
SimpleVector lowerRightFront = new SimpleVector(locationActual.x2, locationActual.y2, locationActual.z1);
SimpleVector upperLeftBack = new SimpleVector(locationActual.x1, locationActual.y1, locationActual.z2);
SimpleVector upperRightBack = new SimpleVector(locationActual.x2, locationActual.y1, locationActual.z2);
SimpleVector lowerLeftBack = new SimpleVector(locationActual.x1, locationActual.y2, locationActual.z2);
SimpleVector lowerRightBack = new SimpleVector(locationActual.x2, locationActual.y2, locationActual.z2);
TextureManager tm = TextureManager.getInstance();
// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1, upperRightFront, 1, 0, tm.getTextureID(debugName + "t1"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1, lowerRightFront, 1, 1, tm.getTextureID(debugName + "t1"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0, lowerLeftBack, 0, 1, tm.getTextureID(debugName + "t0"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1, lowerLeftBack, 0, 1, tm.getTextureID(debugName + "t0"));
// Upper
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1, upperRightBack, 1, 0, tm.getTextureID(debugName + "t4"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1, upperRightFront, 1, 1, tm.getTextureID(debugName + "t4"));
// box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1, upperRightBack, 1, 0);
// box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1, upperRightFront, 1, 1);
// Lower
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0, lowerLeftFront, 0, 1, tm.getTextureID(debugName + "t3"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1, lowerLeftFront, 0, 1, tm.getTextureID(debugName + "t3"));
// Left
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0, lowerLeftFront, 0, 1, tm.getTextureID(debugName + "t2"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1, lowerLeftFront, 0, 1, tm.getTextureID(debugName + "t2"));
// Right
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1, upperRightBack, 1, 0, tm.getTextureID(debugName + "t5"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1, lowerRightBack, 1, 1, tm.getTextureID(debugName + "t5"));
box.setTexture("dfg");
box.build();
}