I want to calculate the position of the camera, but I always get a vector of zeros.
D3DXMATRIX viewMat;
pDev->GetTransform(D3DTS_VIEW, &viewMat);
D3DXMatrixInverse(&viewMat, NULL, &viewMat);
D3DXVECTOR3 camPos(viewMat._41, viewMat._42, viewMat._43);
log->Write( L"Camera Position: %f %f %f\n", camPos.x, camPos.y, camPos.z);
Could anyone please shed some lights on this?
thanks
Jack