I have a camera view matrix that I received from the GL program. I know that this matrix is right-handed, since this is how GL works, but how can I check if this matrix is right-handed or left-handed?
For the projection matrix, I check if the matrix [3] [4] (row major) is positive if it is left. Is it correct?
Thanks.
EDIT
I tried the solution of the determinant, but unfortunately this is incorrect (at least according to my experiments):
I used the DX9 math functions to test it (to avoid possible errors in my code). I ran the following code:
D3DXVECTOR3 vEye(0,0,0); D3DXVECTOR3 vTarget(6,3,0); D3DXVECTOR3 vUp(0,0,1); D3DXMATRIX matViewLH; D3DXMATRIX matViewRH; D3DXMatrixLookAtLH(&matViewLH, &vEye, &vTarget, &vUp); D3DXMatrixLookAtRH(&matViewRH, &vEye, &vTarget, &vUp); float fLHDet = D3DXMatrixDeterminant(&matViewLH); float fRHDet = D3DXMatrixDeterminant(&matViewRH);
And both determinants were equal (both equal 0.99999994) and, obviously, had the same sign.
As for my problem - since I have both a presentation matrix and a projection matrix, and it is relatively easy to check if the projection matrix is LH or RH - I use this information to identify the coordinate system.
source share