本文整理汇总了C#中Microsoft.Kinect.SkeletonPoint.ToVector3方法的典型用法代码示例。如果您正苦于以下问题:C# SkeletonPoint.ToVector3方法的具体用法?C# SkeletonPoint.ToVector3怎么用?C# SkeletonPoint.ToVector3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Kinect.SkeletonPoint
的用法示例。
在下文中一共展示了SkeletonPoint.ToVector3方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public virtual void Add(SkeletonPoint position, KinectSensor sensor, Object format)
{
Entry newEntry = new Entry {Position = position.ToVector3(), Time = DateTime.Now};
Entries.Add(newEntry);
// Drawing
if (DisplayCanvas != null)
{
newEntry.DisplayEllipse = new Ellipse
{
Width = 4,
Height = 4,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
StrokeThickness = 2.0,
Stroke = new SolidColorBrush(DisplayColor),
StrokeLineJoin = PenLineJoin.Round
};
Vector2 vector2 = Tools.Convert(sensor.CoordinateMapper, position, format);
float x = (float)(vector2.X * DisplayCanvas.ActualWidth);
float y = (float)(vector2.Y * DisplayCanvas.ActualHeight);
Canvas.SetLeft(newEntry.DisplayEllipse, x - newEntry.DisplayEllipse.Width / 2);
Canvas.SetTop(newEntry.DisplayEllipse, y - newEntry.DisplayEllipse.Height / 2);
DisplayCanvas.Children.Add(newEntry.DisplayEllipse);
}
// Remove too old positions
if (Entries.Count > WindowSize)
{
Entry entryToRemove = Entries[0];
if (DisplayCanvas != null)
{
DisplayCanvas.Children.Remove(entryToRemove.DisplayEllipse);
}
Entries.Remove(entryToRemove);
}
// Look for gestures
LookForGesture();
}
示例2: Add
/// <summary>
/// Adds the skeleton point to the positions being tracked by the gesture detector.
/// Checks if the gesture has been detected.
/// </summary>
/// <param name="position">The position of the joint being tracked.</param>
public virtual void Add(SkeletonPoint position)
{
if (this.GestureDetected == GestureType.None)
{
GestureEntry newEntry = new GestureEntry(position.ToVector3(), DateTime.UtcNow);
this.GestureEntries.Add(newEntry);
if (this.GestureEntries.Count > this.MaxRecordedPositions)
{
this.GestureEntries.RemoveAt(0);
}
this.LookForGesture();
}
}