Hey guys, this one has been eating all night, and I finally raise my hands for help. Basically, itโs pretty simple to calculate Pitch and Yaw from the viewing matrix immediately after updating the camera:
D3DXMatrixLookAtLH(&m_View, &sCam.pos, &vLookAt, &sCam.up); pDev->SetTransform(D3DTS_VIEW, &m_View);
So my problem is: there must be some way to get Roll in radians, just like Pitch and Yaw get at the end of the code there. I tried several dozen algorithms that seemed to make sense to me, but none of them gave the desired result. I understand that many developers do not track these values, however, I am writing some procedures to reorient and adjust the crop based on the values, and manual tracking breaks when you apply mixed rotations to the View Matrix. So, does anyone have a formula for getting Roll in radians (or degrees, I don't care) from View Matrix? Thanks!
source share