private void FindBasePoints(Contour contour, FingerPoint fingerPoint) { var fingerPointIndex = FindIndex(fingerPoint.Fingertip, contour); var distanceAdjustedOffset = (int)(offsetDistance * indexOffset / fingerPoint.Fingertip.Z); fingerPoint.BaseLeft = contour.GetPointAt(Rollover(fingerPointIndex - distanceAdjustedOffset, contour.Count)); fingerPoint.BaseRight = contour.GetPointAt(Rollover(fingerPointIndex + distanceAdjustedOffset, contour.Count)); var baseCenter = Point.Center(fingerPoint.BaseLeft, fingerPoint.BaseRight); fingerPoint.DirectionVector = Point.Subtract(fingerPoint.Fingertip, baseCenter).GetNormalizedVector(); }
private void PaintFingerPoint(FingerPoint point, DrawingContext drawingContext) { drawingContext.DrawEllipse(Brushes.Red, null, new System.Windows.Point(point.X, point.Y), 5.5, 5.5); drawingContext.DrawEllipse(Brushes.Orange, null, new System.Windows.Point(point.BaseLeft.X, point.BaseLeft.Y), 5.5, 5.5); drawingContext.DrawEllipse(Brushes.Orange, null, new System.Windows.Point(point.BaseRight.X, point.BaseRight.Y), 5.5, 5.5); if (!CCT.NUI.Core.Point.IsZero(point.BaseLeft) && !CCT.NUI.Core.Point.IsZero(point.BaseRight)) { var baseCenter = CCT.NUI.Core.Point.Center(point.BaseLeft, point.BaseRight); drawingContext.DrawLine(this.orangePen, new System.Windows.Point(baseCenter.X, baseCenter.Y), new System.Windows.Point(point.X + point.DirectionVector.X * 60, point.Y + point.DirectionVector.Y * 60)); } }
private Point MapToPresentationArea(FingerPoint fingerPoint, Size originalSize) { var point = new Point(fingerPoint.X, fingerPoint.Y); return new Point(point.X / originalSize.Width * this.TargetSize.Width, point.Y / originalSize.Height * this.TargetSize.Height); }
private void PaintFingerPoint(Graphics g, FingerPoint point) { g.FillEllipse(Brushes.Red, point.X - 5, point.Y - 5, 11, 11); g.DrawEllipse(Pens.Red, point.X - 30, point.Y - 30, 60, 60); g.DrawString(point.Z.ToString(), this.font, Brushes.White, point.X + 3, point.Y + 3); g.FillEllipse(Brushes.Orange, point.BaseLeft.X - 5, point.BaseLeft.Y - 5, 11, 11); g.FillEllipse(Brushes.Orange, point.BaseRight.X - 5, point.BaseRight.Y - 5, 11, 11); if (!CCT.NUI.Core.Point.IsZero(point.BaseLeft) && !CCT.NUI.Core.Point.IsZero(point.BaseRight)) { var baseCenter = CCT.NUI.Core.Point.Center(point.BaseLeft, point.BaseRight); g.DrawLine(Pens.Orange, baseCenter.X, baseCenter.Y, point.X + point.DirectionVector.X * 60, point.Y + point.DirectionVector.Y * 60); } }
private void PaintFingerPoint(FingerPoint point, DrawingContext drawingContext) { drawingContext.DrawEllipse(new SolidColorBrush(Color.FromArgb(Math.Min((byte)100, this.Opacity), 255, 255, 255)), null, new Point(point.X, point.Y), 10, 10); drawingContext.DrawEllipse(new SolidColorBrush(Color.FromArgb(this.Opacity, 255, 255, 255)), null, new Point(point.X, point.Y), 5.5, 5.5); }
private void Select(FingerPoint fingerTip) { ExecuteOnHitResult(fingerTip.Location, (hitTestResult) => { this.selectedVideo = GetByHitTest(hitTestResult as RayMeshGeometry3DHitTestResult); foreach (var video in this.videos.Where(v => v != selectedVideo)) { video.IsSelected = false; } this.selectedVideo.IsSelected = true; }); }