Hey there!
I have a little puzzle that I could use your help with:
Imagine this - I've got a cube that can be rotated around three different axes. I've gathered some data on the cube's rotation, specifically an array of three angles ranging from 0 to 2π.
Now here comes the challenge: how can I figure out which side of the cube is at the bottom just based on these three euler angles?
What I'm envisioning is a nifty function that looks something like this:
function getSideFromAngles(x,y,z) {
// let the magic begin
// for instance, getSideFromAngles(Math.PI/2, 0, 0)
// if x===PI/2 and y===0 and z===0 return "front"
// indicating that the front side of the cube is pointing downwards.
}
Oh, by the way - I can also get quaternions of the cube using Three.js.
Thank you in advance for assisting me!