本文整理汇总了C#中System.Windows.Media.Media3D.Vector3D结构体的典型用法代码示例。如果您正苦于以下问题:C# Vector3D结构体的具体用法?C# Vector3D怎么用?C# Vector3D使用的例子?那么恭喜您, 这里精选的结构体代码示例或许可以为您提供帮助。
Vector3D结构体属于System.Windows.Media.Media3D命名空间,在下文中一共展示了Vector3D结构体的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Vector3D
// Subtracts two 3-D Vectors using the Subtract method and -
// Declaring vector1 and initializing x,y,z values
Vector3D vector1 = new Vector3D(20, 30, 40);
// Declaring vector2 without initializing x,y,z values
Vector3D vector2 = new Vector3D();
// Assigning values to vector2
vector2.X = 45;
vector2.Y = 70;
vector2.Z = 80;
// Subtracting vectors using overload - operator
Vector3D vectorResult1 = new Vector3D();
vectorResult1 = vector1 - vector2;
// vectorResult1 is equal to (-25, -40, -40)
// Subtracting vectors using static Subtract method
Vector3D vectorResult2 = new Vector3D();
vectorResult2 = Vector3D.Subtract(vector1, vector2);
// vector2 is equal to (-25, -40, -40)