public PLANE CreatePlane(Vector3 v1, Vector3 v2, Vector3 v3) { PLANE p = new PLANE(); Vector3 aux1, aux2; aux1 = v1 - v2; aux2 = v3 - v2; p.normal.X = aux2.Y * aux1.Z - aux2.Z * aux1.Y; p.normal.Y = aux2.Z * aux1.X - aux2.X * aux1.Z; p.normal.Z = aux2.X * aux1.Y - aux2.Y * aux1.X; p.normal.Normalize(); p.point = v2; p.d = -(p.normal.X * p.point.X + p.normal.Y * p.point.Y + p.normal.Z + p.point.Z); return(p); }
public PLANE CreatePlane (Vector3 v1, Vector3 v2, Vector3 v3) { PLANE p = new PLANE(); Vector3 aux1, aux2; aux1 = v1 - v2; aux2 = v3 - v2; p.normal.X = aux2.Y * aux1.Z - aux2.Z * aux1.Y; p.normal.Y = aux2.Z * aux1.X - aux2.X * aux1.Z; p.normal.Z = aux2.X * aux1.Y - aux2.Y * aux1.X; p.normal.Normalize(); p.point = v2; p.d = -(p.normal.X * p.point.X + p.normal.Y * p.point.Y + p.normal.Z + p.point.Z); return p; }