Original Post
Hi all, im kinda newbie with matrix and 3d math, but i succesfully implemented my 3rd person camera, doing some simple math. However since 3d math isnt my best skill i'm stuck at getting the camera position. Here is the code The x,y,z is the position of the where the cam is looking, ie : The back of the avatar head ... The matrix is loaded into OpenGl later when i render the scene. But i whant to know where the cam. And i will appreciate any help or tip from pro ;-)
MATRIX4X4 rMat;
m_mat.LoadIdentity();
m_mat.matrix[12]=0;
m_mat.matrix[13]=0;
m_mat.matrix[14]=myCam.m_camDist*4;
rMat.LoadRoationX( ( ( -gfkCamXAngle) * piover180 ) );
m_mat = m_mat * rMat;
rMat.LoadRoationY( ( ( -gfkCamYAngle) * piover180 ) );
m_mat = m_mat * rMat;
rMat.LoadIdentity();
rMat.matrix[12] =- x;
rMat.matrix[13] =- (y-myCam.m_camDist);
rMat.matrix[14] =- ( z );
m_mat = m_mat * rMat;