# Angle of Rotations from World Transformation matrix

This topic is 4265 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I want to get the angle of rotation alone the 3 axis from the world matrix. Is there an api in directx8 to get these values?

##### Share on other sites
just combine the 3 rotation matrices (x,y,z)

and extract the information out of the sin, cosine terms in the matrix

the final rotation matrix looks like this
|R11 R12 R13|
|R21 R21 R23| = R = Rz*Ry*Rx
|R31 R32 R33|

Rx(PHI): => R32/R33 = tan(PHI)
Ry(THETA): => R31 = -sin(THETA)
Rz(OMEGA): => R21/R11 = tan(OMEGA)

take care of the special case cos(THETA)=0
remark:
tan(x) = sin(x)/cos(x)
sin(x)*sin(x) + cos(x)*cos(x) = 1

don t just pick these formulas, combine the matrix on your own otherwise you will probably fail to understand

##### Share on other sites
D3DXMatrixDecompose() returns a quaternion representing the rotation.

1. 1
2. 2
3. 3
Rutin
20
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633656
• Total Posts
3013189
×