| Matrix44DCreatePerspectiveFieldOfView Method |
Creates a right-handed, perspective projection matrix based on a field of view. (Only
available in the XNA-compatible build.)
Namespace: DigitalRune.Mathematics.AlgebraAssembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax public static Matrix44D CreatePerspectiveFieldOfView(
double fieldOfViewY,
double aspectRatio,
double zNear,
double zFar
)
Public Shared Function CreatePerspectiveFieldOfView (
fieldOfViewY As Double,
aspectRatio As Double,
zNear As Double,
zFar As Double
) As Matrix44D
public:
static Matrix44D CreatePerspectiveFieldOfView(
double fieldOfViewY,
double aspectRatio,
double zNear,
double zFar
)
static member CreatePerspectiveFieldOfView :
fieldOfViewY : float *
aspectRatio : float *
zNear : float *
zFar : float -> Matrix44D
Parameters
- fieldOfViewY
- Type: SystemDouble
The vertical field of view. - aspectRatio
- Type: SystemDouble
The aspect ratio (width / height). - zNear
- Type: SystemDouble
The minimum z-value of the view volume. (Distance of the near view plane.)
- zFar
- Type: SystemDouble
The maximum z-value of the view volume. (Distance of the far view plane.)
Return Value
Type:
Matrix44D
The right-handed, perspective projection matrix.
Exceptions Exception | Condition |
---|
ArgumentOutOfRangeException | fieldOfViewY is not between 0 and π radians (0° and 180°),
aspectRatio is negative or 0, zNear is negative or 0,
or zFar is negative or 0.
|
ArgumentException | zNear is greater than or equal to zFar.
|
Remarks
This method is available only in the XNA-compatible build of the
DigitalRune.Mathematics.dll.
In contrast to all preceding coordinate spaces (model space, world space, view space) the
projection space is left-handed! This is necessary because DirectX uses a left-handed
clip space.
In the projection space the x and y-coordinates range from −1 to 1, and the z-coordinates
range from 0 (near) to 1 (far).
Infinite Projections:
zFar can be set to PositiveInfinity to create an
infinite projection where the far clip plane is at infinity.
See Also