I'm trying to get rotation values along the x, y and z axis from a matrix that can include rotation, translation and scale data. Currently I have this function to return the y rotational value:
float GetYRotDegree( void )
{
return D3DXToDegree( asin( m_mMatrix._13 ) );
};
What I'm doing to test this is first rotating along the y by 90 degrees, then rotate it by 1 more degree, and this returns 89, not 91.
I understand that this is caused because of using asin, and I did find a Stack Overflow question that was 100% identical to mine, and was solved by doing this:
Degree(atan2(orientmatrix[0][2], orientmatrix[0][0]))
The problem with this is, it assumes that there's no other rotational, scale and translation in the matrix, however I do have other data in it.
Any help would be great, and I do appreciate any help given!