Is there a way to get the color of a cube face that is facing the camera? My cube’s geometry is a box geometry and I have colored each side of the cube a different color using MeshBasicMaterials.
const boxWidth = 1;
const boxHeight = 1;
const boxDepth = 1;
const geometry = new THREE.BoxGeometry(boxWidth, boxHeight, boxDepth);
const materials = [
new THREE.MeshBasicMaterial({color: 0x0000ff, transparent: true}), // blue
new THREE.MeshBasicMaterial({color: 0xffffff, transparent: true}), // white
new THREE.MeshBasicMaterial({color: 0xffff00, transparent: true}), // yellow
new THREE.MeshBasicMaterial({color: 0x008000, transparent: true}), // green
new THREE.MeshBasicMaterial({color: 0xffa500, transparent: true}), // orange
new THREE.MeshBasicMaterial({color: 0xff0000, transparent: true}), // red
]
const cube = new THREE.Mesh(geometry, materials);