Click or drag to resize

UtilGetAlignMatrix Method (Vector3, Vector3, Vector3)

Get the rotation matrix needed to align the initial vector with the target vector.

Namespace:  Demo3D.Common
Assembly:  Demo3D.Common (in Demo3D.Common.dll) Version: 15.0.2.11458
Syntax
C#
public static Matrix GetAlignMatrix(
	Vector3 initial,
	Vector3 target,
	Vector3 fallbackAxis
)

Parameters

initial
Type: Microsoft.DirectXVector3
Initial vector
target
Type: Microsoft.DirectXVector3
Vector to align with
fallbackAxis
Type: Microsoft.DirectXVector3
Axis to rotate around when initial and target are nearly parallel

Return Value

Type: Matrix
Alignment matrix
See Also