Drawing3d documented Class Library

Matrix.LookAt Method

Gets the transformation matrix for a "look at" situation. The camera is at CameraPosition and looks to CameraTarget. Additionally a normalvector CameraUpVector has to be given, because the Camera can turn up or down...

[Visual Basic]
Public Shared Sub LookAt( _
   ByVal CameraPosition As xyz, _
   ByVal CameraTarget As xyz, _
   ByVal CameraUpVector As xyz _
)
[C#]
public static Matrix LookAt(
   xyz CameraPosition,
   xyz CameraTarget,
   xyz CameraUpVector
);

Parameters

CameraPosition
Position of the camera
CameraTarget
The camera looks to that point
CameraUpVector
Normalvector of the camera

Return Value

Example

Matrix M = LookAt(new xyz(0,10,2), new xyz(0,0,2), new xyz(0,0,1));

See Also

Matrix Class | Drawing3d.Math Namespace