Matrix4x4::CreatePerspectiveFieldOfView Method

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

Namespace:  System.Numerics
Assembly:  System.Numerics.Vectors (in System.Numerics.Vectors.dll)

public:
static Matrix4x4 CreatePerspectiveFieldOfView(
	float fieldOfView, 
	float aspectRatio, 
	float nearPlaneDistance, 
	float farPlaneDistance
)

Parameters

fieldOfView
Type: System::Single

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

aspectRatio
Type: System::Single

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

nearPlaneDistance
Type: System::Single

The distance to the near view plane.

farPlaneDistance
Type: System::Single

The distance to the far view plane.

Return Value

Type: System.Numerics::Matrix4x4
The perspective projection matrix.

ExceptionCondition
ArgumentOutOfRangeException

fieldOfView is less than or equal to zero.

-or-

fieldOfView is greater than or equal to Math::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.

Show: