MathUtilEx.

LookRotation(Vector3, Vector3, Vector3) Method

Summary

Creates a rotation with the specified forward and upwards directions.
Namespace
StrideToolkit.Mathematics
Containing Type
MathUtilEx

Syntax

public static Quaternion LookRotation(Vector3 eye, Vector3 target, Vector3 up)

Examples

var cameraRotation = Quaternion.LookRotation(cameraPosition, targetPosition, Vector3.UnitY);

Parameters

Name Type Description
eye Vector3 The postion of the observer. i.e. camera
target Vector3 The location of the object to look-at.
up Vector3 The vector that defines which direction is up.

Return Value

Type Description
Quaternion The created quaternion rotation