private static Vector3 GetDirection(JointType t1, JointType t2, Skeleton skeleton) { Vector3 p1 = KMath.KINECTVectorToXNA(skeleton.Joints[t1].Position); Vector3 p2 = KMath.KINECTVectorToXNA(skeleton.Joints[t2].Position); return(p2 - p1); }
private void UpdateDescription() { if (SelectedBone != -1) { Vector3 p = bones[SelectedBone].BonePos.Position; Vector3 rot = KMath.GetAngleFromQuaternion(bones[SelectedBone].BonePos.Orientation); // Opis LOffset.Text = "Offset: X = " + p.X.ToString("0.000") + " Y = " + p.Y.ToString("0.000") + " Z = " + p.Z.ToString("0.000"); LRotation.Text = "Rotation: Y = " + rot.X.ToString("0.000") + "° P = " + rot.Y.ToString("0.000") + "° R = " + rot.Z.ToString("0.000") + "°"; LRoot.Text = (bones[SelectedBone].ParentIndex == -1) ? "Root Bone: Yes" : "Root Bone: No"; LJoint.Text = "Kinect Joint: " + BoneConnections[SelectedBone].ToString(); } }