本文整理匯總了C#中Vector3F.NormalizeInPlace方法的典型用法代碼示例。如果您正苦於以下問題:C# Vector3F.NormalizeInPlace方法的具體用法?C# Vector3F.NormalizeInPlace怎麽用?C# Vector3F.NormalizeInPlace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vector3F
的用法示例。
在下文中一共展示了Vector3F.NormalizeInPlace方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MatrixLookAtLH
public static Matrix4x4F MatrixLookAtLH(Vector3F eye, Vector3F at, Vector3F up)
{
Vector3F right, vec;
vec = at - eye;
vec.NormalizeInPlace();
right = Vector3F.Cross(up, vec);
up = Vector3F.Cross(vec, right);
right.NormalizeInPlace();
up.NormalizeInPlace();
return new Matrix4x4F(
right.X,
up.X,
vec.X,
0.0f,
right.Y,
up.Y,
vec.Y,
0.0f,
right.Z,
up.Z,
vec.Z,
0.0f,
-Vector3F.Dot(right, eye),
-Vector3F.Dot(up, eye),
-Vector3F.Dot(vec, eye),
1.0f
);
}