Matrix4x4::CreatePerspective Method

Creates a perspective projection matrix from the given view volume dimensions.

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

public:
static Matrix4x4 CreatePerspective(
	float width, 
	float height, 
	float nearPlaneDistance, 
	float farPlaneDistance
)

Parameters

width
Type: System::Single

The width of the view volume at the near view plane.

height
Type: System::Single

The height of the view volume at the near view plane.

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

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: