private void ShowGesturesFeedback(PreposeGestures.App app) { foreach (var gesture in app.Gestures) { var progress = new PreposeGestureRecognizer.Controls.GestureFeedback(gesture); foreach (var evt in gestureNamedEvents) { if(evt.Item1.CompareTo(gesture.Name) == 0) { progress.TriggeredEvents.SetEvent(evt.Item2); } } this.GesturesFeedbackPanel.Children.Add(progress); this.GesturesFeedbackPanel.Height += progress.Height; } this.GesturesFeedbackViewer.Visibility = System.Windows.Visibility.Visible; }
private void Reader_FrameArrived(object sender, PreposeGestures.PreposeGesturesFrameArrivedEventArgs e) { var frame = e.FrameReference.AcquireFrame(); if (frame != null && frame.results != null) { this.FOutStatus.AssignFrom(frame.results); } }
private static void AddZ3JointToVectors3D( Z3Body targetBody, IReadOnlyDictionary<Microsoft.Kinect.JointType, Microsoft.Kinect.Joint> baseJoints, Dictionary<Microsoft.Kinect.JointType, Vector3D> jointVectors, PreposeGestures.JointType jointType) { var vector3D = new Vector3D( targetBody.Joints[jointType].GetXValue(), targetBody.Joints[jointType].GetYValue(), -targetBody.Joints[jointType].GetZValue()); //var norm = Z3Math.GetRealValue(targetBody.Norms[jointType]); var norm = new Vector3D( baseJoints[(Microsoft.Kinect.JointType)jointType].Position.X - baseJoints[(Microsoft.Kinect.JointType)JointTypeHelper.GetFather(jointType)].Position.X, baseJoints[(Microsoft.Kinect.JointType)jointType].Position.Y - baseJoints[(Microsoft.Kinect.JointType)JointTypeHelper.GetFather(jointType)].Position.Y, baseJoints[(Microsoft.Kinect.JointType)jointType].Position.Z - baseJoints[(Microsoft.Kinect.JointType)JointTypeHelper.GetFather(jointType)].Position.Z).Length; vector3D = vector3D * norm; jointVectors.Add((Microsoft.Kinect.JointType)jointType, vector3D); }