现在的位置: 首页 > 综合 > 正文

XMMatrixPerspectiveFovLH

2018年02月06日 ⁄ 综合 ⁄ 共 703字 ⁄ 字号 评论关闭

5.6.3.6 XMMatrixPerspectiveFovLH A perspective projection matrix can be built with the following XNA Math function: XMMATRIX XMMatrixPerspectiveFovLH( // returns projection matrix FLOAT FovAngleY, // vertical field of view angle in radians FLOAT AspectRatio,
// aspect ratio = width / height FLOAT NearZ, // distance to near plane FLOAT FarZ); // distance to far plane The following code snippet illustrates how to use D3DXMatrixPerspectiveFovLH. Here, we specify a 45° vertical field of view, a near plane at z = 1,
and a far plane at z = 1000 (these lengths are in view space). 

XMMATRIX P = XMMatrixPerspectiveFovLH(0.25f*MathX::Pi, AspectRatio(), 1.0f, 1000.0f); The aspect ratio is taken to match our window aspect ratio: float D3DApp::AspectRatio()const { return static_cast<float>(mClientWidth) / mClientHeight; }

【上篇】
【下篇】

抱歉!评论已关闭.