이 MSDN 문서가 어떻게 수학 더욱 설명한다
http://msdn.microsoft.com/en-us/library/bb147302%28VS.85%29.aspx
D3DXMATRIX
ProjectionMatrix(const float near_plane, // Distance to near clipping
// plane
const float far_plane, // Distance to far clipping
// plane
const float fov_horiz, // Horizontal field of view
// angle, in radians
const float fov_vert) // Vertical field of view
// angle, in radians
{
float h, w, Q;
w = (float)1/tan(fov_horiz*0.5); // 1/tan(x) == cot(x)
h = (float)1/tan(fov_vert*0.5); // 1/tan(x) == cot(x)
Q = far_plane/(far_plane - near_plane);
D3DXMATRIX ret;
ZeroMemory(&ret, sizeof(ret));
ret(0, 0) = w;
ret(1, 1) = h;
ret(2, 2) = Q;
ret(3, 2) = -Q*near_plane;
ret(2, 3) = 1;
return ret;
} // End of ProjectionMatrix
(C++에서이기는) 독립적으로 고려 수평 및 수직 FOV를 취하는 관점 행렬을 생성하는 방법을 쓸 도시 이 방법의 C# 버전을 작성하는 데 도움이되도록 위에 링크 된 기사. 행운을 빌어 요 :-)
흠 ... C#으로 처음 해석 할 때 약간 더 ... 홀수 ... 결과 ... :) private Matrix CreateProjection (float horizontalFov float verticalFov, float nearPlane, float farPlane) { var w = 1f/(float) Math.Tan (horizontalFov * 0.5f); var h = 1f/(float) Math.Tan (verticalFov * 0.5f); var q = farPlane/(farPlane - nearPlane); return new Matrix (w, 0, 0, 0, 0, h, 0, 0, 0, 0, q, 1, 0, 0, -q * nearPlane, 0); } – lzcd