I have imported a mesh and have added some events to allow the user to change the rotation of the mesh with the cursor. The mesh is a bit like a 6 sided die. I ideally want to trigger an event based on what side of the ‘die’ is facing the camera. The camera is just a static universal camera that points at the die.
I have thought of using getDirection or rays or even checking if the rotation was between certain values but that seems like a hacky way of doing things.
Ideally I’d want to trigger the event based on which face of the die is the closest to facing the camera if that makes sense.
EDIT: Sorry, have been busy with other bits so not had chance to update this post. I have linked the playground below with the code I am using to handle the rotations.
When the user moves the cube around, depending on which face of the cube is facing the camera, I want to display different HTML. What I am struggling to get started on is how to determine which face of the cube is facing the camera at any which time.
I was thinkiing I could check the rotation of the camera for example if X is between -45 deg and 45 deg show face 1, between 45 and 90 face 2 etc but how would I get the rotation in terms of degrees?