Here is the code for my textured cube:
const textureLoader: TextureLoader = new TextureLoader();
const textureArray: MeshBasicMaterial[] = [
new MeshBasicMaterial({ map: textureLoader.load("./model/front.jpeg") }),
new MeshBasicMaterial({ map: textureLoader.load("./model/back.jpeg") }),
new MeshBasicMaterial({ map: textureLoader.load("./model/top.jpeg") }),
new MeshBasicMaterial({ map: textureLoader.load("./model/bottom.jpeg") }),
new MeshBasicMaterial({ map: textureLoader.load("./model/left.jpeg") }),
new MeshBasicMaterial({ map: textureLoader.load("./model/right.jpeg") }),
];
textureArray.forEach((_, index) => {
textureArray[index].side = BackSide;
});
const cubeGeometry: BoxGeometry = new BoxGeometry(5, 5, 5);
const cube: Mesh = new Mesh(cubeGeometry, textureArray);
scene.add(cube);
I have not encountered any errors and the screen remains black. Can you help me identify the issue?
The bundler I am using is parcel.