Make rightX
, rightY
, rightZ
instance variables of your class.
public class MyKinect
{
private double rightX;
private double rightY;
private double rightZ;
public void positions(Skeleton skeleton)
{
// get the joint
Joint rightHand = skeleton.Joints[JointType.HandRight];
// get the individual points of the right hand
rightX = rightHand.Position.X;
rightY = rightHand.Position.Y;
rightZ = rightHand.Position.Z;
}
private void stoji_Click(object sender, RoutedEventArgs e)
{
File.AppendAllText(@"E:\skuska.txt", rightX + ", " + rightY + ", " +rightZ + Environment.NewLine);
}
}