Creates a perspective projection matrix.

Namespace:  AForge.Math
Assembly:  AForge.Math (in AForge.Math.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

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

Parameters

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

Return Value

Return a perspective projection matrix.

Exceptions

ExceptionCondition
System..::.ArgumentOutOfRangeExceptionBoth near and far view planes' distances must be greater than zero.
System..::.ArgumentExceptionNear plane must be closer than the far plane.

See Also