D3DMXMatrixPerspectiveFovLHFxd

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Builds a left-handed perspective projection matrix in fixed point format based on a field of view.

Syntax

D3DMXMATRIXFXD* WINAPI D3DMXMatrixPerspectiveFovLHFxd(
  D3DMXMATRIXFXD* pOut,
  FIXED           fovy,
  FIXED           Aspect,
  FIXED           zn,
  FIXED           zf
);

Parameters

  • pOut
    [in, out] Pointer to the D3DMXMATRIXFXD structure that is the result of the operation.
  • fovY
    [in] Field of view, in the y direction, in radians.
  • Aspect
    [in] Aspect ratio, defined as view space width divided by height.
  • zn
    [in] Z-value of the near view-plane.
  • zf
    [in] Z-value of the far view-plane.

Return Value

Pointer to a D3DMXMATRIXFXD structure that is a left-handed perspective projection matrix.

Remarks

The return value for this function is the same value returned in the pOut parameter. In this way, the D3DMXMatrixPerspectiveFovLHFxd function can be used as a parameter for another function.

This function computes the returned matrix as shown. For clarity, the conversions to fixed point numbers are omitted from the matrix.

xScale  0       0               0
0       yScale  0               0
0       0       zf/(zf-zn)      1
0       0       -zn*zf/(zf-zn)  0

These variables are calculated from the following formulas.

FIXED yScale = D3DMXDivFxd(D3DMXToFixed(cos(0.5f * D3DMXToFloat(fovy))),
                           D3DMXToFixed(sin(0.5f * D3DMXToFloat(fovy))))
FIXED xScale = D3DMXDivFxd(yScale, aspect)

Requirements

Header d3dmx.h
Library D3dmx.lib
Windows Embedded CE Windows Embedded CE 6.0 and later
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later

See Also

Reference

D3DMX Functions
D3DMXMATRIXFXD
D3DMXMatrixPerspectiveFovLH