Ovgl::Matrix44 Ovgl::MatrixPerspectiveLH( float ViewWidth, float ViewHeight, float NearZ, float FarZ)
{
Ovgl::Matrix44 out = {0};
float depth = FarZ - NearZ;
float q = -(FarZ + NearZ) / depth;
float qn = -2 * (FarZ * NearZ) / depth;
float w = 2 * NearZ / ViewWidth;
float h = 2 * NearZ / ViewHeight;
out._11 = w;
out._12 = 0;
out._13 = 0;
out._14 = 0;
out._21 = 0;
out._22 = h;
out._23 = 0;
out._24 = 0;
out._31 = 0;
out._32 = 0;
out._33 = q;
out._34 = -1;
out._41 = 0;
out._42 = 0;
out._43 = qn;
out._44 = 0;
return out;
}
Does anyone know how D3DXMatrixPerspectiveFovLH works?