Upraviť

Zdieľať cez


Matrix4x4.CreatePerspectiveFieldOfView(Single, Single, Single, Single) Method

Definition

Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances.

public:
 static System::Numerics::Matrix4x4 CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance);
public static System.Numerics.Matrix4x4 CreatePerspectiveFieldOfView (float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance);
static member CreatePerspectiveFieldOfView : single * single * single * single -> System.Numerics.Matrix4x4
Public Shared Function CreatePerspectiveFieldOfView (fieldOfView As Single, aspectRatio As Single, nearPlaneDistance As Single, farPlaneDistance As Single) As Matrix4x4

Parameters

fieldOfView
Single

The field of view in the y direction, in radians.

aspectRatio
Single

The aspect ratio, defined as view space width divided by height.

nearPlaneDistance
Single

The distance to the near view plane.

farPlaneDistance
Single

The distance to the far view plane.

Returns

The perspective projection matrix.

Exceptions

fieldOfView is less than or equal to zero.

-or-

fieldOfView is greater than or equal to PI.

nearPlaneDistance is less than or equal to zero.

-or-

farPlaneDistance is less than or equal to zero.

-or-

nearPlaneDistance is greater than or equal to farPlaneDistance.

Applies to