Пример #1
0
 private void SetupCanvas(TrackingEllipseCanvas canvas, MoveableBodyPart head, MoveableBodyPart lHand, MoveableBodyPart rHand, MoveableBodyPart lShoulder, MoveableBodyPart rShoulder)
 {
     canvas.StartTracking(lHand, rHand, head, lShoulder, rShoulder);
     canvas.ChangeColor(lHand, Brushes.Blue);
     canvas.ChangeColor(rHand, Brushes.Blue);
     canvas.ChangeColor(head, Brushes.LightGray);
     canvas.ChangeColor(lShoulder, Brushes.LightGray);
     canvas.ChangeColor(rShoulder, Brushes.LightGray);
     canvas.ForceActivision(head);
     canvas.ForceActivision(lShoulder);
     canvas.ForceActivision(rShoulder);
     canvas.Viewport = TrackingWindow.WithRadiusBetween(lShoulder, head).ResizedBy(2).Within(canvas);
 }
Пример #2
0
 private void SetupSelectionContext(TrackingEllipseCanvas canvas, MoveableBodyPart lHand, MoveableBodyPart rHand)
 {
     LeftKinectBox = new HighlightCanvasItemContext(canvas);
     RightKinectBox = new HighlightCanvasItemContext(canvas);
 }
Пример #3
0
        public void StartTracking(TrackingEllipseCanvas canvas)
        {
            var head = GenericActionFactory.Create<MoveableBodyPart>(KSensor, (s) => s.Head);
            var lHand = GenericActionFactory.Create<MoveableBodyPart>(KSensor, (s) => s.LeftHand);
            var rHand = GenericActionFactory.Create<MoveableBodyPart>(KSensor, (s) => s.RightHand);
            var lShoulder = GenericActionFactory.Create<MoveableBodyPart>(KSensor, (s) => s.LeftShoulder);
            var rShoulder = GenericActionFactory.Create<MoveableBodyPart>(KSensor, (s) => s.RightShoulder);

            SetupCanvas(canvas, head, lHand, rHand, lShoulder, rShoulder);
            SetupSelectionContext(canvas, lHand, rHand);
            SetupContextEvents(lHand, rHand);
        }