You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KinectExercise_FrancoBroda/PostureTester/Program.cs

62 lines
3.1 KiB

using Microsoft.Kinect;
using MyGestureBank;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace PostureTester
{
public class Program
{
private static List<Tuple<JointType, JointType>> bones = new List<Tuple<JointType, JointType>>();
static void Main(string[] args)
{
// Create a body
Body[] body = new Body[1];
// Create a posture
PostureHandUpRight postureHandUpRight = new PostureHandUpRight();
PostureHandUpLeft postureHandUpLeft = new PostureHandUpLeft();
// Make the body do the posture
bones.Add(new Tuple<JointType, JointType>(JointType.Head, JointType.Neck));
bones.Add(new Tuple<JointType, JointType>(JointType.Neck, JointType.SpineShoulder));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineShoulder, JointType.SpineMid));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineMid, JointType.SpineBase));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineShoulder, JointType.ShoulderRight));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineShoulder, JointType.ShoulderLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineBase, JointType.HipRight));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineBase, JointType.HipLeft));
// Bras droit
bones.Add(new Tuple<JointType, JointType>(JointType.ShoulderRight, JointType.ElbowRight));
bones.Add(new Tuple<JointType, JointType>(JointType.ElbowRight, JointType.WristRight));
bones.Add(new Tuple<JointType, JointType>(JointType.WristRight, JointType.HandRight));
bones.Add(new Tuple<JointType, JointType>(JointType.HandRight, JointType.HandTipRight));
bones.Add(new Tuple<JointType, JointType>(JointType.WristRight, JointType.ThumbRight));
// Bras gauche
bones.Add(new Tuple<JointType, JointType>(JointType.ShoulderLeft, JointType.ElbowLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.ElbowLeft, JointType.WristLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.WristLeft, JointType.HandLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.HandLeft, JointType.HandTipLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.WristLeft, JointType.ThumbLeft));
// Jambe droite
bones.Add(new Tuple<JointType, JointType>(JointType.HipRight, JointType.KneeRight));
bones.Add(new Tuple<JointType, JointType>(JointType.KneeRight, JointType.AnkleRight));
bones.Add(new Tuple<JointType, JointType>(JointType.AnkleRight, JointType.FootRight));
// Jambe gauche
bones.Add(new Tuple<JointType, JointType>(JointType.HipLeft, JointType.KneeLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.KneeLeft, JointType.AnkleLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.AnkleLeft, JointType.FootLeft));
}
}
}