public static Sub ( Microsoft.Kinect.SkeletonPoint sp1, Microsoft.Kinect.SkeletonPoint sp2 ) : System.Windows.Media.Media3D.Vector3D | ||
sp1 | Microsoft.Kinect.SkeletonPoint | |
sp2 | Microsoft.Kinect.SkeletonPoint | |
return | System.Windows.Media.Media3D.Vector3D |
/// <summary> /// Relative position to the shoulder center joint in world coordinates. /// </summary> /// <param name="rect"></param> /// <param name="depthData"></param> /// <param name="width"></param> /// <param name="height"></param> /// <param name="skeleton"></param> /// <param name="mapper"></param> /// <returns></returns> public static Vector3D RelativePosToShoulder(SkeletonPoint point, Skeleton skeleton) { var shoulderCenterJoint = SkeletonUtil.GetJoint(skeleton, JointType.ShoulderCenter); var relPos = SkeletonUtil.Sub(point, shoulderCenterJoint.Position); return(relPos); }
public static Vector3D PointDirection(SkeletonPoint hand, SkeletonPoint elbow) { var dir = SkeletonUtil.Sub(hand, elbow); var angle = new Vector3D(); // Angle in radians, between -pi and pi. angle.X = Math.Atan2(dir.X, dir.Z); angle.Y = Math.Atan2(dir.Y, dir.Z); return(angle); }