Click or drag to resize
DigitalRuneMatrix44FCreateLookAt Method
Creates a right-handed look-at matrix (view matrix). (Only available in the XNA-compatible build.)

Namespace: DigitalRune.Mathematics.Algebra
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
public static Matrix44F CreateLookAt(
	Vector3F position,
	Vector3F target,
	Vector3F upVector
)

Parameters

position
Type: DigitalRune.Mathematics.AlgebraVector3F
The position of the viewer.
target
Type: DigitalRune.Mathematics.AlgebraVector3F
The target at which the viewer is looking.
upVector
Type: DigitalRune.Mathematics.AlgebraVector3F
The direction that is "up" from the viewer's point of view. (Does not need to be normalized.)

Return Value

Type: Matrix44F
The right-handed look-at matrix (view matrix).
Exceptions
ExceptionCondition
ArgumentExceptionposition is the same as target.
ArgumentExceptionupVector is (0, 0, 0).
DivideByZeroException The camera direction (target - position) is probably pointing in the same or opposite direction as upVector. (The two vectors must not be parallel.)
Remarks

This method is available only in the XNA-compatible build of the DigitalRune.Mathematics.dll.

A look-at matrix is also known as view matrix. It transforms a position from world space to the view space. In view space x-axis points to the right, the y-axis points up, and the z-axis points towards the viewer.

See Also