Click or drag to resize
Accord.NET (logo)

Matrix4x4CreatePerspective Method

Creates a perspective projection matrix.

Namespace:  Accord.Math
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.8.0
Syntax
public static Matrix4x4 CreatePerspective(
	float width,
	float height,
	float nearPlaneDistance,
	float farPlaneDistance
)
Request Example View Source

Parameters

width
Type: SystemSingle
Width of the view volume at the near view plane.
height
Type: SystemSingle
Height of the view volume at the near view plane.
nearPlaneDistance
Type: SystemSingle
Distance to the near view plane.
farPlaneDistance
Type: SystemSingle
Distance to the far view plane.

Return Value

Type: Matrix4x4
Return a perspective projection matrix.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionBoth near and far view planes' distances must be greater than zero.
ArgumentExceptionNear plane must be closer than the far plane.
See Also