Matrix.CreateLookAt Method (Vector3, Vector3, Vector3)

Creates a view matrix.

Namespace:  Microsoft.Xna.Framework
Assembly:  Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)

public static Matrix CreateLookAt(
	Vector3 cameraPosition,
	Vector3 cameraTarget,
	Vector3 cameraUpVector
)

Parameters

cameraPosition
Type: Microsoft.Xna.Framework.Vector3
The position of the camera.
cameraTarget
Type: Microsoft.Xna.Framework.Vector3
The target towards which the camera is pointing.
cameraUpVector
Type: Microsoft.Xna.Framework.Vector3
The direction that is "up" from the camera's point of view.

Return Value

Type: Microsoft.Xna.Framework.Matrix
The created view matrix.

View space, sometimes called camera space, is similar to world space in that it is typically used for the entire scene. However, in view space, the origin is at the viewer or camera.

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: