Hi , everyone .
I moved from Direct3d (Retained mode ) to OpenGL about a year ago and im rewriting a litte project ive been working on .
Its a sort of flight sim and I need the current rotations for an ADI ball .
ADI is an Attitude Direction Indicator .
It worked fine in DirectX cause I used the GetRotation to get the Up and Direction vector and used this formula to get my rotations :
Now I use matrices for rotations but how to extract the rotations from that ?
Well , thats what Im asking for .
Graphics Gems (vol 2 or 3, I forget) has code to break a 4x4 homogeneous matrix into its translation, rotation, scaling and shear components, if it’s not singular.
I stole this from elsewhere on the forums:
Use a matrix decompose routine, of course: http://www.acm.org/tog/GraphicsGems/gemsii/unmatrix.c
You may want to get to know the Graphics Gems site: http://www.acm.org/tog/GraphicsGems/
Following on from Michail’s post, I was trawling the internet the other day (working out what gimbal lock was) and came across this web page. It’s a more recent version of the The Matrix and Quaternions FAQ.