#how to put different colors on different faces of a box
5 messages · Page 1 of 1 (latest)
i guess that could work id just have to use solid color images
you can use an array of materials, like this:
let box = new THREE.Mesh(
boxGeometry,
[
new THREE.MeshStandardMaterial({ color: "red" }), // left
new THREE.MeshStandardMaterial({ color: "green" }), // right
new THREE.MeshStandardMaterial({ color: "blue" }), // top
new THREE.MeshStandardMaterial({ color: "yellow" }), // bottom
new THREE.MeshStandardMaterial({ color: "white" }), // front
new THREE.MeshStandardMaterial({ color: "black" }) // back
]
);
nvm i got it working with cube texture loader
You really want to use SDFT's solution if you can. It's a lot less wasteful.