本文整理汇总了C#中Vector3D.ToPoint3D方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3D.ToPoint3D方法的具体用法?C# Vector3D.ToPoint3D怎么用?C# Vector3D.ToPoint3D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3D
的用法示例。
在下文中一共展示了Vector3D.ToPoint3D方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IntersectsRayAt
public static Vector3D? IntersectsRayAt(this BoundingBoxD boundingBox, Vector3D position, Vector3D rayTo)
{
var corners = boundingBox.GetCorners();
var tariangles = new int[][] {
new [] {2,1,0},
new [] {3,2,0},
new [] {4,5,6},
new [] {4,6,7},
new [] {0,1,5},
new [] {0,5,4},
new [] {7,6,2},
new [] {7,2,3},
new [] {0,4,7},
new [] {0,7,3},
new [] {5,1,2},
new [] {5,2,6}};
foreach (var triangle in tariangles)
{
System.Windows.Media.Media3D.Point3D intersection;
int norm;
if (MeshHelper.RayIntersetTriangleRound(corners[triangle[0]].ToPoint3D(), corners[triangle[1]].ToPoint3D(), corners[triangle[2]].ToPoint3D(), position.ToPoint3D(), rayTo.ToPoint3D(), out intersection, out norm))
{
return intersection.ToVector3D();
}
}
return null;
}