I'm developing a game using jmonkeyengine 3, but this question is more about math (rotation) than anything else, so I think I'm asking on the correct site. I'm terrible with math and I've tried to figure out what I can on my own, but when in doubt.. ask! You don't need to know anything about jmonkeyengine to answer the question.
Sooo.. here's what I have set up:
- The camera doesn't move
- Its rotation is (0,1,0,0)
- Its direction is (0,0,0,-1)
- A die is dropped so that 4 is visible (you can see the 4 pips in the camera)
- When dropped, the die with 4 showing reports rotation (0,0,0,1)
- The camera also has function "getLeft" which reports a vector (-1,0,0)
- and the function "getUp" which reports a vector (0,1,0)
At any given point in time, how could I compare the rotation of the camera to the rotation of the die to determine the resulting roll?