Beispiel #1
0
        public override void OnFrame(Controller controller)
        {
            // Get the most recent frame and report some basic information

            if (OnFrameEvent != null)
            {
                OnFrameEvent.Invoke(controller, null);
            }

            Frame frame = controller.Frame();

            SafeWriteLine("Frame id: " + frame.Id
                          + ", timestamp: " + frame.Timestamp
                          + ", hands: " + frame.Hands.Count
                          + ", fingers: " + frame.Fingers.Count
                          + ", tools: " + frame.Tools.Count
                          + ", gestures: " + frame.Gestures().Count);

            //foreach (Hand hand in frame.Hands) {
            //    SafeWriteLine("  Hand id: " + hand.Id
            //                + ", palm position: " + hand.PalmPosition);
            //    // Get the hand's normal vector and direction
            //    Vector normal = hand.PalmNormal;
            //    Vector direction = hand.Direction;

            //    // Calculate the hand's pitch, roll, and yaw angles
            //    SafeWriteLine("  Hand pitch: " + direction.Pitch * 180.0f / (float)Math.PI + " degrees, "
            //                + "roll: " + normal.Roll * 180.0f / (float)Math.PI + " degrees, "
            //                + "yaw: " + direction.Yaw * 180.0f / (float)Math.PI + " degrees");
            //}

            if (!frame.Hands.IsEmpty || !frame.Gestures().IsEmpty)
            {
                SafeWriteLine("");
            }
        }
Beispiel #2
0
 private void SetOnFrame(Frame Item)
 {
     OnFrameEvent?.Invoke(Item);
 }