【发布时间】:2017-06-16 16:05:56
【问题描述】:
我开始使用 Directx 11,但在设置相机时遇到了一些问题。 我想将原点设置在屏幕的左上角,目前它位于左下角,这就是我的设置方式:
D3DXMatrixIdentity(&mProjection);
D3DXMatrixIdentity(&mView);
mPosition = D3DXVECTOR3{ 0.0f, 0.0f, -0.5f };
mTarget = D3DXVECTOR3{ 0.0f, 0.0f, 0.0f };
mUp = D3DXVECTOR3{ 0.0f, 0.0f, 0.0f };
D3DXMatrixOrthoOffCenterLH(&mProjection,
0.0f, static_cast<Float32>(WindowWidth),
0.0f, static_cast<Float32>(WindowHeight), 0.0f, 1.0f);
【问题讨论】:
-
您应该避免使用旧的 D3DXMath 库。它仅在已弃用的
D3DX11帮助程序库中受支持。见Living without D3DX
标签: c++ directx-11