Esempio n. 1
0
        public void GestureRecognition()
        {
            currentGesture = Gesture.Nothing;

            if (hay_sensor && kinectData != null)
            {
                //Ver en que mano chequear gesto
                Microsoft.Kinect.JointType handIdx = right_hand_sel ? Microsoft.Kinect.JointType.HandRight : Microsoft.Kinect.JointType.HandLeft;
            }
            else
            {
                // Espacio para abrir / cerrar la mano
                if (GuiController.Instance.D3dInput.keyPressed(Microsoft.DirectX.DirectInput.Key.Space))
                {
                    if (right_hand_sel)
                    {
                        right_hand.gripping = !right_hand.gripping;
                    }
                    else
                    {
                        left_hand.gripping = !left_hand.gripping;
                    }
                }

                // el wheel del mouse, representa la mano hacia atras, en el movimiento de seleccion
                if ((right_hand_sel && right_hand.position.Z > 0) || (!right_hand_sel && left_hand.position.Z > 0))
                {
                    currentGesture = Gesture.Pressing;
                }
            }
        }
Esempio n. 2
0
        private Vertex3 GetJointPosition(Microsoft.Kinect.Skeleton skeleton, JointType jointType)
        {
            Microsoft.Kinect.JointType     kinectJointType = JointUtilities.TranslateJointType(jointType);
            Microsoft.Kinect.SkeletonPoint kinectPoint     = skeleton.Joints[kinectJointType].Position;
            Vertex3 position = GetPosition(kinectPoint);

            return(position);
        }
Esempio n. 3
0
 public CoOrd(float x1, float y1, float z1, Microsoft.Kinect.JointType m1, object m2, int mPc)
 {
     x                   = x1;
     y                   = y1;
     z                   = z1;
     markerType          = m1;
     markerTrackingState = m2;
     markerPC            = mPc;
 }
Esempio n. 4
0
 /// <summary>
 /// gets transform by joint name
 /// </summary>
 public Transform getTransformByJointame(Microsoft.Kinect.JointType jointname)
 {
     foreach (MyJoint joint in Joints)
     {
         if (joint.jointName == jointname.ToString())
         {
             return(joint.transform);
         }
     }
     return(null);
 }
Esempio n. 5
0
        /// <summary>
        /// Convert from <code>Microsoft.Kinect.JointType</code> to <code>org.btg.Star.Rhapsody.JointType</code>
        /// </summary>
        /// <param name="joint">A Kinect SDK JointType</param>
        /// <returns>The equivalent JointType in Rhapsody</returns>
        public static org.btg.Star.Rhapsody.JointType Convert(Microsoft.Kinect.JointType joint)
        {
            switch (joint)
            {
            case Microsoft.Kinect.JointType.AnkleLeft:
                return(org.btg.Star.Rhapsody.JointType.AnkleLeft);

            case Microsoft.Kinect.JointType.AnkleRight:
                return(org.btg.Star.Rhapsody.JointType.AnkleRight);

            case Microsoft.Kinect.JointType.ElbowLeft:
                return(org.btg.Star.Rhapsody.JointType.ElbowLeft);

            case Microsoft.Kinect.JointType.ElbowRight:
                return(org.btg.Star.Rhapsody.JointType.ElbowRight);

            case Microsoft.Kinect.JointType.FootLeft:
                return(org.btg.Star.Rhapsody.JointType.FootLeft);

            case Microsoft.Kinect.JointType.FootRight:
                return(org.btg.Star.Rhapsody.JointType.FootRight);

            case Microsoft.Kinect.JointType.HandLeft:
                return(org.btg.Star.Rhapsody.JointType.HandLeft);

            case Microsoft.Kinect.JointType.HandRight:
                return(org.btg.Star.Rhapsody.JointType.HandRight);

            case Microsoft.Kinect.JointType.Head:
                return(org.btg.Star.Rhapsody.JointType.Head);

            case Microsoft.Kinect.JointType.HipCenter:
                return(org.btg.Star.Rhapsody.JointType.HipCentre);

            case Microsoft.Kinect.JointType.HipLeft:
                return(org.btg.Star.Rhapsody.JointType.HipLeft);

            case Microsoft.Kinect.JointType.HipRight:
                return(org.btg.Star.Rhapsody.JointType.HipRight);

            case Microsoft.Kinect.JointType.KneeLeft:
                return(org.btg.Star.Rhapsody.JointType.KneeLeft);

            case Microsoft.Kinect.JointType.KneeRight:
                return(org.btg.Star.Rhapsody.JointType.KneeRight);

            case Microsoft.Kinect.JointType.ShoulderCenter:
                return(org.btg.Star.Rhapsody.JointType.ShoulderCentre);

            case Microsoft.Kinect.JointType.ShoulderLeft:
                return(org.btg.Star.Rhapsody.JointType.ShoulderLeft);

            case Microsoft.Kinect.JointType.ShoulderRight:
                return(org.btg.Star.Rhapsody.JointType.ShoulderRight);

            case Microsoft.Kinect.JointType.Spine:
                return(org.btg.Star.Rhapsody.JointType.Spine);

            case Microsoft.Kinect.JointType.WristLeft:
                return(org.btg.Star.Rhapsody.JointType.WristLeft);

            case Microsoft.Kinect.JointType.WristRight:
                return(org.btg.Star.Rhapsody.JointType.WristRight);

            default:
                throw new ArgumentOutOfRangeException("joint", "The specified joint type is not supported");
            }
        }
Esempio n. 6
0
 private Microsoft.Kinect.JointTrackingState JointTrackingState(Microsoft.Kinect.Skeleton skeleton, JointType jointType)
 {
     Microsoft.Kinect.JointType kinectJointType = JointUtilities.TranslateJointType(jointType);
     return(skeleton.Joints[kinectJointType].TrackingState);
 }