-------------------------------------------------------------------------------
| 1017 | |
| 1018 | //------------------------------------------------------------------------------- |
| 1019 | int GetProjectionMatrix(aiMatrix4x4 &p_mOut) { |
| 1020 | const float fFarPlane = 100.0f; |
| 1021 | const float fNearPlane = 0.1f; |
| 1022 | const float fFOV = (float)(45.0 * 0.0174532925); |
| 1023 | |
| 1024 | const float s = 1.0f / tanf(fFOV * 0.5f); |
| 1025 | const float Q = fFarPlane / (fFarPlane - fNearPlane); |
| 1026 | |
| 1027 | RECT sRect; |
| 1028 | GetWindowRect(GetDlgItem(g_hDlg, IDC_RT), &sRect); |
| 1029 | sRect.right -= sRect.left; |
| 1030 | sRect.bottom -= sRect.top; |
| 1031 | const float fAspect = (float)sRect.right / (float)sRect.bottom; |
| 1032 | |
| 1033 | p_mOut = aiMatrix4x4( |
| 1034 | s / fAspect, 0.0f, 0.0f, 0.0f, |
| 1035 | 0.0f, s, 0.0f, 0.0f, |
| 1036 | 0.0f, 0.0f, Q, 1.0f, |
| 1037 | 0.0f, 0.0f, -Q * fNearPlane, 0.0f); |
| 1038 | return 1; |
| 1039 | } |
| 1040 | |
| 1041 | //------------------------------------------------------------------------------- |
| 1042 | aiVector3D GetCameraMatrix(aiMatrix4x4 &p_mOut) { |
no test coverage detected