Please help.
My camera orientation on 3D max is:
90 -30 0
When I export to X3D file it will have this orientation:
0, 0, -1, -0.524
And I can easily convert this to the angle of the camera on the z axis like this:
-1 * -0.524 * 180/Math.PI = 30;
Problem:
But when I rotate the camera on 3D max to:
90 -30 90
on X3D I get this vector:
-0.251, 0.935, -0.251,-1.638
How can I figure out the value of z angle?
Found a way to do it in Stage3D, probably the same on other platforms:
first you create an empty matrix3D:
then you rotate it with the given orientation vector from the X3D file:
decompose the matrix
you get xyz angles in radians so turn radians to degrees: