Пример #1
0
 //判断点是否在三角面上
 public static bool PointinTriangle(Vertex3 A, Vertex3 B, Vertex3 C, Vertex3 P)
 {
     return(SameSide(A, B, C, P) && SameSide(B, C, A, P) && SameSide(C, A, B, P));
 }
Пример #2
0
 public static double DotProduct(Vector3 v1, Vertex3 v2)
 {
     return(v1.x * v2.x + v1.y * v2.y + v1.z * v2.z);
 }
Пример #3
0
 //判断两个点是否相等
 public static bool IsSame(Vertex3 v1, Vertex3 v2)
 {
     return(v1.x == v2.x && v1.y == v2.y && v1.z == v2.z);
 }
Пример #4
0
 public Vector3(Vertex3 V1, Vertex3 V2)
 {
     x = V2.x - V1.x;
     y = V2.y - V1.y;
     z = V2.z - V1.z;
 }