本文整理汇总了C#中JointType类的典型用法代码示例。如果您正苦于以下问题:C# JointType类的具体用法?C# JointType怎么用?C# JointType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JointType类属于命名空间,在下文中一共展示了JointType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OrientedJoint
/// <summary>
/// Initializes a new instance of the <see cref="Trame.Implementation.Skeleton.OrientedJoint"/> class.
/// </summary>
/// <param name="type">Type.</param>
/// <param name="valid">If set to <c>true</c> valid.</param>
public OrientedJoint(JointType type, bool valid)
{
this.type = type;
this.isValid = valid;
orientation = new Vector4();
point = new Vector3();
}
开发者ID:i2e-haw-hamburg,项目名称:trame,代码行数:12,代码来源:OrientedJoint.cs
示例2: readarmangle
public int readarmangle(Skeleton[] skeldata, JointType joint1, JointType joint2, int ang1)
{
ang1 = 0;
Vector2 joint1pos = new Vector2(0, 0);
Vector2 joint2pos = new Vector2(0, 0);
int ang = 0;
foreach (Skeleton data in skeldata)
{
if (data.TrackingState == SkeletonTrackingState.Tracked)
{
foreach (Joint joint in data.Joints)
{
if (joint.JointType == joint1)
{
joint1pos.X = joint.Position.X;
joint1pos.Y = joint.Position.Y;
}
if (joint.JointType == joint2)
{
joint2pos.X = joint.Position.X;
joint2pos.Y = joint.Position.Y;
}
}
Vector2 anglevec = joint1pos - joint2pos;
ang = (int)MathHelper.ToDegrees((float)Math.Atan2(anglevec.X, anglevec.Y));
if (ang < 0) ang += 360;
}
}
return ang;
}
开发者ID:jwhalen93,项目名称:CSR,代码行数:34,代码来源:Calculations.cs
示例3: ConnectedJoint
public ConnectedJoint(JointType jointType, int jointID)
{
this.jointType = jointType;
this.jointID = jointID;
this.nextJoint = null;
this.childGestureRulesCollection = new List<ChildGestureRules>();
}
开发者ID:rjabaker,项目名称:Skynet,代码行数:7,代码来源:ConnectedJoint.cs
示例4: Add
public void Add(Skeleton skeleton, JointType jointType)
{
var trackingID = skeleton.TrackingId;
var position = skeleton.Joints.Where(j => j.JointType == jointType).First().Position.ToVector3();
Add(position, trackingID);
}
开发者ID:Hitchhikrr,项目名称:harley,代码行数:7,代码来源:ContextTracker.cs
示例5: UpdateSkeleton
public void UpdateSkeleton(JointType jt, IJoint j)
{
lock (_joints)
{
_joints[jt] = j;
}
}
开发者ID:i2e-haw-hamburg,项目名称:trame.skeleton,代码行数:7,代码来源:InMapSkeleton.cs
示例6: Plot
void Plot(JointType centerID, JointType baseID, JointCollection joints)
{
float centerX;
float centerY;
GetCoordinates(centerID, joints, out centerX, out centerY);
float baseX;
float baseY;
GetCoordinates(baseID, joints, out baseX, out baseY);
double diameter = Math.Abs(baseY - centerY);
Ellipse ellipse = new Ellipse
{
Width = diameter,
Height = diameter,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
StrokeThickness = 4.0,
Stroke = new SolidColorBrush(Colors.Green),
StrokeLineJoin = PenLineJoin.Round
};
Canvas.SetLeft(ellipse, centerX - ellipse.Width / 2);
Canvas.SetTop(ellipse, centerY - ellipse.Height / 2);
rootCanvas.Children.Add(ellipse);
}
开发者ID:Hitchhikrr,项目名称:harley,代码行数:30,代码来源:SkeletonDisplayManager.cs
示例7: getDataPoint
public KinectDataPoint getDataPoint(JointType type, KinectUser user)
{
KinectDataPoint result = null;
jointMap.TryGetValue(type, out result);
return result;
}
开发者ID:philiWeitz,项目名称:InteractionTechniques,代码行数:7,代码来源:SkeletonServiceStub.cs
示例8: GetRelativeVelocity
/// <summary>
/// Calculates the relative velocity of a joint referencing to a second one.</summary>
/// <param name="steady">
/// The referenctial JointType.</param>
/// <param name="moving">
/// The moving JointType of interest</param>
/// <returns>
/// Returns the relative velocity in meters</returns>
public static double GetRelativeVelocity(JointType steady, JointType moving)
{
if (!(MainWindow.jointRecords.PositionExistsAt(steady, 0) && MainWindow.jointRecords.PositionExistsAt(steady, 1) &&
MainWindow.jointRecords.PositionExistsAt(steady, 2)
&& MainWindow.jointRecords.PositionExistsAt(moving, 0) && MainWindow.jointRecords.PositionExistsAt(moving, 1)
&& MainWindow.jointRecords.PositionExistsAt(moving, 2) ))
{
return 0;
}
CameraSpacePoint d0 = SubstractedPointsAt(steady, moving, 0);
CameraSpacePoint d1 = SubstractedPointsAt(steady, moving, 1);
if (!(MainWindow.jointRecords.PositionExistsAt(steady, 3) && MainWindow.jointRecords.PositionExistsAt(steady, 3)))
{
return DistanceBetweenPoints(d0, d1) / MainWindow.jointRecords.MillisBetweenPositions(moving, 1, 0);
}
CameraSpacePoint d2 = SubstractedPointsAt(steady, moving, 2);
CameraSpacePoint d3 = SubstractedPointsAt(steady, moving, 3);
return Median(
DistanceBetweenPoints(d0, d1) * 1000.0 / MainWindow.jointRecords.MillisBetweenPositions(moving, 1, 0),
DistanceBetweenPoints(d1, d2) * 1000.0 / MainWindow.jointRecords.MillisBetweenPositions(moving, 2, 1),
DistanceBetweenPoints(d2, d3) * 1000.0 / MainWindow.jointRecords.MillisBetweenPositions(moving, 3, 2)
);
}
开发者ID:rachelriv,项目名称:Instrumovement,代码行数:35,代码来源:VelocityComputer.cs
示例9: DrawBone
private void DrawBone(Skeleton skeleton, DrawingContext drawingContext, JointType jointType0,
JointType jointType1)
{
var joint0 = skeleton.Joints[jointType0];
var joint1 = skeleton.Joints[jointType1];
// If we can't find either of these joints, exit
if (joint0.TrackingState == JointTrackingState.NotTracked ||
joint1.TrackingState == JointTrackingState.NotTracked)
{
return;
}
// Don't draw if both points are inferred
if (joint0.TrackingState == JointTrackingState.Inferred &&
joint1.TrackingState == JointTrackingState.Inferred)
{
return;
}
// We assume all drawn bones are inferred unless BOTH joints are tracked
Pen drawPen = _inferredBonePen;
if (joint0.TrackingState == JointTrackingState.Tracked && joint1.TrackingState == JointTrackingState.Tracked)
{
drawPen = _trackedBonePen;
}
drawingContext.DrawLine(drawPen, SkeletonPointToScreen(joint0.Position),
SkeletonPointToScreen(joint1.Position));
}
开发者ID:merbla,项目名称:KinectUs,代码行数:30,代码来源:ShellViewModel.cs
示例10: DesenharMaosUsuario
public static void DesenharMaosUsuario(
this SkeletonFrame pQuadro,
KinectSensor pKinectSensor,
Canvas pCanvasParaDesenhar,
Brush pCorDesenho,
JointType pMaoParaDesenhar)
{
if (pKinectSensor == null)
throw new ArgumentNullException("kinectSensor");
if (pCanvasParaDesenhar == null)
throw new ArgumentNullException("canvasParaDesenhar");
Skeleton lEsqueleto = ObterEsqueletoUsuario(pQuadro);
if (lEsqueleto != null)
{
EsqueletoUsuarioAuxiliar lEsqueletoUsuarioAuxiliar = new EsqueletoUsuarioAuxiliar(pKinectSensor);
//desenha mao direita
//lEsqueletoUsuarioAuxiliar.DesenharUmaMaoPintura(
// lEsqueleto.Joints[JointType.HandRight],
// pCanvasParaDesenhar,
// Brushes.Aquamarine);
//desenha mao esquerda
lEsqueletoUsuarioAuxiliar.DesenharUmaMaoPintura(
//lEsqueleto.Joints[JointType.HandRight],
lEsqueleto.Joints[pMaoParaDesenhar],
pCanvasParaDesenhar,
pCorDesenho);
}
}
开发者ID:nunesrenato86,项目名称:TCC,代码行数:34,代码来源:Extensao.cs
示例11: AdjacentJointPair
public AdjacentJointPair(JointType left, JointType right, double thresholdHeight)
{
JointTypes = Tuple.Create(left, right);
ThresholdHeight = thresholdHeight;
DeactivateJointPair();
}
开发者ID:techx,项目名称:old-techfair-kinect-booth,代码行数:7,代码来源:AdjacentJointPair.cs
示例12: SwipeCondition
public SwipeCondition(Person p, JointType leftOrRightHand)
: base(p)
{
_index = 0;
_hand = leftOrRightHand;
_checker = new Checker(p);
}
开发者ID:JastAir,项目名称:Kinect,代码行数:7,代码来源:SwipeCondition.cs
示例13: MainWindow
// MainWindow Constructor
public MainWindow()
{
InitializeComponent();
// Instantiate the wave player
_player = new SineWavePlayer();
// Set up the UI
freqLabel.Content = _player.Frequency;
ampLabel.Content = _player.Amplitude;
for (int i = 0; i < _player.frequencyDict.Count; i++)
{
keyBox.Items.Add(_player.frequencyDict.ElementAt(i).Key);
}
keyBox.SelectedIndex = 0;
// Initialize the wave player
ChangeKey();
_player.Frequency = _player.MinFreq;
// Set the starting handedness
_freqHand = JointType.HandRight;
_ampHand = JointType.HandLeft;
// Draw the guides
_freqInterval = guideCanvas.Height / 12;
//_ampInterval = guideCanvas.Height / 4;
DrawGuides();
// Instantiate and initialize the KinectHelper
_helper = new KinectHelper(true, false, true);
_helper.ToggleSeatedMode(true);
_helper.SkeletonDataChanged += new KinectHelper.SkeletonDataChangedEvent(SkeletonDataChange);
skeletonImage.Source = _helper.skeletonBitmap;
rgbImage.Source = _helper.colorBitmap;
}
开发者ID:bencentra,项目名称:kinect-theremin,代码行数:31,代码来源:MainWindow.xaml.cs
示例14: GestureRecognizer
/// <summary>
/// constructor with frames and threshold
/// </summary>
/// <param name="frames">framesToCompare</param>
/// <param name="thresh">threshold</param>
/// <param name="jointToTrack">default joint</param>
public GestureRecognizer(int frames, double threshold, JointType jointToTrack)
{
_framesToCompare = frames;
_threshold = threshold;
_trackedJoint = jointToTrack;
_coordinatesList = new List<SkeletonPoint>();
}
开发者ID:Apolotary,项目名称:Kinesthesia,代码行数:13,代码来源:GestureRecognizer.cs
示例15: GestureInProgress
public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture,
float progress, JointType joint, Vector3 screenPos)
{
//GestureInfo.guiText.text = string.Format("{0} Progress: {1:F1}%", gesture, (progress * 100));
// if(gesture == KinectGestures.Gestures.Click && progress > 0.3f)
// {
// string sGestureText = string.Format ("{0} {1:F1}% complete", gesture, progress * 100);
// if(GestureInfo != null)
// GestureInfo.guiText.text = sGestureText;
//
// progressDisplayed = true;
// }
// else
if((gesture == KinectGestures.Gestures.ZoomOut || gesture == KinectGestures.Gestures.ZoomIn) && progress > 0.5f)
{
string sGestureText = string.Format ("{0} detected, zoom={1:F1}%", gesture, screenPos.z * 100);
if(GestureInfo != null)
GestureInfo.guiText.text = sGestureText;
progressDisplayed = true;
}
else if(gesture == KinectGestures.Gestures.Wheel && progress > 0.5f)
{
string sGestureText = string.Format ("{0} detected, angle={1:F1} deg", gesture, screenPos.z);
if(GestureInfo != null)
GestureInfo.guiText.text = sGestureText;
progressDisplayed = true;
}
}
开发者ID:hazlett,项目名称:Parkinsons,代码行数:30,代码来源:MinecartGestureListener.cs
示例16: checkDrumHit
internal void checkDrumHit(MainWindow.Player player, JointType joint)
{
//checkDrumHit code
//MessageBox.Show(Convert.ToString(hitAreaStart[0][1]));
if (player.skeleton != null && player.skeleton.Joints[joint].TrackingState == JointTrackingState.Tracked)
{
double posX = player.skeleton.Joints[joint].Position.X;
double posY = player.skeleton.Joints[joint].Position.Y;
double posZ = player.skeleton.Joints[joint].Position.Z;
for (int i = 0; i <= hitArea[player.skeleton.TrackingId].Count - 1; i++)
{
if (hitArea[player.skeleton.TrackingId][i].X1 < posX && hitArea[player.skeleton.TrackingId][i].X2 > posX && hitArea[player.skeleton.TrackingId][i].Y1 < posY && hitArea[player.skeleton.TrackingId][i].Y2 > posY && hitArea[player.skeleton.TrackingId][i].Z1 < posZ && hitArea[player.skeleton.TrackingId][i].Z2 > posZ)
{
if (!insideArea[player.skeleton.TrackingId][joint][i])
{
if (handMovements.difference != null)
{
if (handMovements.difference[player.skeleton.TrackingId][joint].Y < -0.01 || ((joint == JointType.FootLeft || joint == JointType.FootRight) && handMovements.difference[player.skeleton.TrackingId][joint].Z < -0.02))
{
hitDrum("drum" + i);
Debug.Print("HIT! " + i);
insideArea[player.skeleton.TrackingId][joint][i] = true;
}
}
}
}
else
{
insideArea[player.skeleton.TrackingId][joint][i] = false;
}
}
}
}
开发者ID:MattCrouch,项目名称:Moto,代码行数:35,代码来源:drumSpace.cs
示例17: DrawBone
private void DrawBone(KinectSensor sensor, Skeleton skeleton, DrawingContext drawingContext, JointType jointType0, JointType jointType1)
{
Joint joint0 = skeleton.Joints[jointType0];
Joint joint1 = skeleton.Joints[jointType1];
// If we can't find either of these joints, exit
if (joint0.TrackingState == JointTrackingState.NotTracked ||
joint1.TrackingState == JointTrackingState.NotTracked)
{
return;
}
// Don't draw if both points are inferred
if (joint0.TrackingState == JointTrackingState.Inferred &&
joint1.TrackingState == JointTrackingState.Inferred)
{
return;
}
// We assume all drawn bones are inferred unless BOTH joints are tracked
Pen drawPen = GetInferredPen(sensor);
if (joint0.TrackingState == JointTrackingState.Tracked && joint1.TrackingState == JointTrackingState.Tracked)
{
drawPen = GetTrackedPen(sensor);
}
drawingContext.DrawLine(drawPen, Transform(sensor, joint0.Position), Transform(sensor, joint1.Position));
}
开发者ID:virrkharia,项目名称:dynamight,代码行数:28,代码来源:OverviewWindow.xaml.cs
示例18: GetParentJoint
// returns the parent joint of the given joint
public static JointType GetParentJoint(JointType joint)
{
switch (joint)
{
case JointType.SpineBase:
return JointType.SpineBase;
case JointType.Neck:
return JointType.SpineShoulder;
case JointType.SpineShoulder:
return JointType.SpineBase;
case JointType.ShoulderLeft:
case JointType.ShoulderRight:
return JointType.SpineShoulder;
case JointType.HipLeft:
case JointType.HipRight:
return JointType.SpineBase;
case JointType.HandTipLeft:
case JointType.ThumbLeft:
return JointType.HandLeft;
case JointType.HandTipRight:
case JointType.ThumbRight:
return JointType.HandRight;
}
return (JointType)((int)joint - 1);
}
开发者ID:puzpuz,项目名称:LocomotionTest,代码行数:33,代码来源:KinectMathHelper.cs
示例19: KalmanJoint
/// <summary>
/// Create a Kalman smoothing joint with default configuration values.
/// </summary>
/// <param name="jointType">The joint type to create</param>
public KalmanJoint(JointType jointType)
: base(jointType)
{
var parms = new KalmanSmoothingParameters();
_measurementUncertainty = new Vector3(parms.MeasurementUncertainty);
_jitterRadius = parms.JitterRadius;
}
开发者ID:KinectEx,项目名称:KinectEx,代码行数:11,代码来源:KalmanJoint.cs
示例20: DrawBone
/// <summary>
/// Draws a bone line between two joints
/// </summary>
/// <param name="skeleton">skeleton to draw bones from</param>
/// <param name="drawingContext">drawing context to draw to</param>
/// <param name="jointType0">joint to start drawing from</param>
/// <param name="jointType1">joint to end drawing at</param>
private static void DrawBone(Skeleton skeleton, Graphics drawingContext, JointType jointType0, JointType jointType1)
{
Joint joint0 = skeleton.Joints[jointType0];
Joint joint1 = skeleton.Joints[jointType1];
// If we can't find either of these joints, exit
if (joint0.TrackingState == JointTrackingState.NotTracked ||
joint1.TrackingState == JointTrackingState.NotTracked)
{
return;
}
// Don't draw if both points are inferred
if (joint0.TrackingState == JointTrackingState.Inferred &&
joint1.TrackingState == JointTrackingState.Inferred)
{
return;
}
// We assume all drawn bones are inferred unless BOTH joints are tracked
Pen drawPen = new Pen(Brushes.Gray, 1);
if (joint0.TrackingState == JointTrackingState.Tracked && joint1.TrackingState == JointTrackingState.Tracked)
{
drawPen = new Pen(Brushes.Green, 6);
}
drawingContext.DrawLine(drawPen,
(int)SkeletonPointToScreen(joint0.Position).X,
(int)SkeletonPointToScreen(joint0.Position).Y,
(int)SkeletonPointToScreen(joint1.Position).X,
(int)SkeletonPointToScreen(joint1.Position).Y);
}
开发者ID:scherbinin,项目名称:Kinect,代码行数:40,代码来源:SkeletVisualizer.cs
注:本文中的JointType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论