本文整理汇总了C#中Vector4F.ProjectTo方法的典型用法代码示例。如果您正苦于以下问题:C# Vector4F.ProjectTo方法的具体用法?C# Vector4F.ProjectTo怎么用?C# Vector4F.ProjectTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector4F
的用法示例。
在下文中一共展示了Vector4F.ProjectTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectTo2
public void ProjectTo2()
{
// Project (1, 1, 1) to axes
Vector4F projection = new Vector4F(1, 1, 1, 0);
projection.ProjectTo(Vector4F.UnitX);
Assert.AreEqual(Vector4F.UnitX, projection);
projection = Vector4F.One;
projection.ProjectTo(Vector4F.UnitY);
Assert.AreEqual(Vector4F.UnitY, projection);
projection = Vector4F.One;
projection.ProjectTo(Vector4F.UnitZ);
Assert.AreEqual(Vector4F.UnitZ, projection);
// Project axes to (1, 1, 1)
Vector4F expected = new Vector4F(1, 1, 1, 0) / 3.0f;
projection = Vector4F.UnitX;
projection.ProjectTo(new Vector4F(1, 1, 1, 0));
Assert.AreEqual(expected, projection);
projection = Vector4F.UnitY;
projection.ProjectTo(new Vector4F(1, 1, 1, 0));
Assert.AreEqual(expected, projection);
projection = Vector4F.UnitZ;
projection.ProjectTo(new Vector4F(1, 1, 1, 0));
Assert.AreEqual(expected, projection);
}