Exemplo n.º 1
0
 //two kinect vector to system 3d vector between those two vectors .
 public System.Windows.Media.Media3D.Vector3D vectorbetween23dvectors(Microsoft.Research.Kinect.Nui.Vector vec1, Microsoft.Research.Kinect.Nui.Vector vec2)
 {
     System.Windows.Media.Media3D.Vector3D vect1 = new System.Windows.Media.Media3D.Vector3D(vec1.X, vec1.Y, vec1.Z);
     System.Windows.Media.Media3D.Vector3D vect2 = new System.Windows.Media.Media3D.Vector3D(vec2.X, vec2.Y, vec2.Z);
     System.Windows.Media.Media3D.Vector3D vect  = vect1 - vect2;
     return(vect);
 }
 bool GetUserIsInRange(Microsoft.Research.Kinect.Nui.Vector torsoPosition)
 {
     return(torsoPosition.Z > this.MinDistanceFromCamera &
            torsoPosition.Z <(this.MinDistanceFromCamera + this.BoundsDepth)
                             & torsoPosition.X> -this.BoundsWidth / 2 &
            torsoPosition.X < this.BoundsWidth / 2);
 }
        void RefreshSensorPositions()
        {
            this.leftHand = Kinect.LeftHand;
            this.rightHand = Kinect.RightHand;
            this.rightHandPoint = Kinect.GetRightHandDisplayPosition(Width, Height);
            this.leftHandPoint = Kinect.GetLeftHandDisplayPosition(Width, Height);

            this.torso = Kinect.Torso;
            this.rightHandCanMove =
                Math.Abs(this.torso.Z - this.rightHand.Z) >= MinTorsoDistance &
                Math.Abs(this.torso.Z - this.leftHand.Z) < MinTorsoDistance;

            this.leftHandCanMove =
                 Math.Abs(this.torso.Z - this.leftHand.Z) >= MinTorsoDistance &
                 Math.Abs(this.torso.Z - this.rightHand.Z) < MinTorsoDistance;

            this.canZoom =
                Math.Abs(this.torso.Z - this.rightHand.Z) >= MinTorsoDistance &
                Math.Abs(this.torso.Z - this.leftHand.Z) >= MinTorsoDistance;
        }
Exemplo n.º 4
0
 //single kinect vector to system 3d .
 public System.Windows.Media.Media3D.Vector3D kvector3d2system3d(Microsoft.Research.Kinect.Nui.Vector vec)
 {
     System.Windows.Media.Media3D.Vector3D vect = new System.Windows.Media.Media3D.Vector3D(vec.X, vec.Y, vec.Z);
     return(vect);
 }