Sdílet prostřednictvím


Matrix.CreateLookAt Method (Vector3, Vector3, Vector3, Matrix)

Creates a view matrix.

Syntax

'Declaration
Public Shared Sub CreateLookAt ( _
         ref cameraPosition As Vector3, _
         ref cameraTarget As Vector3, _
         ref cameraUpVector As Vector3, _
         out result As Matrix _
)
public static void CreateLookAt (
         ref Vector3 cameraPosition,
         ref Vector3 cameraTarget,
         ref Vector3 cameraUpVector,
         out Matrix result
)
public:
static void CreateLookAt(
         ref Vector3 cameraPosition,
         ref Vector3 cameraTarget,
         ref Vector3 cameraUpVector,
         out Matrix result
)

Parameters

  • cameraPosition
    Type: Vector3
    The position of the camera.
  • cameraTarget
    Type: Vector3
    The target towards which the camera is pointing.
  • cameraUpVector
    Type: Vector3
    The direction that is "up" from the camera's point of view.
  • result
    Type: Matrix
    [OutAttribute] The created view matrix.

Remarks

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.

Requirements

Namespace: Microsoft.Xna.Framework

Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Platforms

Windows Phone