public void CalibrateStandard(Float4[,] data, Rect standardA, Rect standardB) { Plane a = PlaneFromDepthData(data, new RectangleRegion(standardA.TopLeft, standardA.BottomRight)); Plane b = PlaneFromDepthData(data, new RectangleRegion(standardB.TopLeft, standardB.BottomRight)); Line axis = Plane.Intersect(a, b); Vector3 origin = axis.Intersect(Ground); Table = new Plane(origin, (axis.Direction.Y > 0 ? -axis.Direction : axis.Direction)); StandardA = a; StandardB = b; IsCalibrated = true; }
public static Vector3 DistanceBetweenLines(Line a, Line b) { Vector3 d = (a.Direction * b.Direction).Direction; return(d * ((b.Origin - a.Origin) % d)); }