Matrix.PerspectiveFovLH Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Builds a left-handed perspective projection matrix based on a field of view.
Namespace: Microsoft.WindowsMobile.DirectX
Assembly: Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)
Syntax
'Declaration
Public Shared Function PerspectiveFovLH ( _
fieldOfViewY As Single, _
aspectRatio As Single, _
znearPlane As Single, _
zfarPlane As Single _
) As Matrix
'Usage
Dim fieldOfViewY As Single
Dim aspectRatio As Single
Dim znearPlane As Single
Dim zfarPlane As Single
Dim returnValue As Matrix
returnValue = Matrix.PerspectiveFovLH(fieldOfViewY, _
aspectRatio, znearPlane, zfarPlane)
public static Matrix PerspectiveFovLH(
float fieldOfViewY,
float aspectRatio,
float znearPlane,
float zfarPlane
)
public:
static Matrix PerspectiveFovLH(
float fieldOfViewY,
float aspectRatio,
float znearPlane,
float zfarPlane
)
static member PerspectiveFovLH :
fieldOfViewY:float32 *
aspectRatio:float32 *
znearPlane:float32 *
zfarPlane:float32 -> Matrix
Parameters
- fieldOfViewY
Type: System.Single
Field of view in the y direction, in radians.
- aspectRatio
Type: System.Single
Aspect ratio, defined as the view space width divided by height.
- znearPlane
Type: System.Single
Z-value of the near view plane.
- zfarPlane
Type: System.Single
Z-value of the far view plane.
Return Value
Type: Microsoft.WindowsMobile.DirectX.Matrix
A Matrix structure that is a left-handed perspective projection matrix.
Examples
The following example shows how to use the PerspectiveFovLH method. This example is taken from the Direct3D Mobile Matrices Sample in the Windows Software Development Kit (SDK).
' For the projection matrix, set up a perspective transform (which
' transforms geometry from 3-D view space to 2-D viewport space, with
' a perspective divide making objects smaller in the distance). To build
' a perspective transform, you need the field of view (1/4 PI is common),
' the aspect ratio, and the near and far clipping planes (which define
' the distances at which geometry should no longer be rendered).
device.Transform.Projection = Matrix.PerspectiveFovLH(System.Convert.ToSingle(Math.PI) / 4, 1.0F, 1.0F, 100.0F)
// For the projection matrix, set up a perspective transform (which
// transforms geometry from 3-D view space to 2-D viewport space, with
// a perspective divide making objects smaller in the distance). To build
// a perspective transform, you need the field of view (1/4 PI is common),
// the aspect ratio, and the near and far clipping planes (which define
// the distances at which geometry should no longer be rendered).
device.Transform.Projection = Matrix.PerspectiveFovLH((float)Math.PI / 4, 1.0f, 1.0f, 100.0f);
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Platforms
Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Compact Framework
Supported in: 3.5, 2.0