In my code, I am calculating the intersections of mouse clicks with Three.js as follows:
myVector.set(
(event.clientX / window.innerWidth) * 2 - 1,
-(event.clientY / window.innerHeight) * 2 + 1,
0.5);
myVector.unproject(myApp.camera);
myRay.set(myApp.camera.position, myVector.sub(myApp.camera.position).normalize());
var intersections = myRay.intersectObjects(myApp.colliders, false);
After successfully obtaining the intersections, I can access properties such as
distance, face, faceIndex, object,
and point
, which allow me to trigger a specific function.
The issue I'm facing is determining when a click occurs on a specific face of an object, for example, on the grey face of a cube in the provided example.
Apologies for any confusion caused by my explanation.