예제 #1
0
        public static void AddKinectSkeleton(MySkeleton Skeleton)
        {
            //Die Person steht falsch herum im Koordinatensystem der Kinect! Es wird erst beim Abspeichern korrigiert, weshalb die Verarbeitung noch mit umgekehrten Koordinaten erfolgt
            MyBone hipCenter = new MyBone(null, JointType.HipCenter.ToString(), 6, TransAxis.None, true);
            MyBone hipCenter2 = new MyBone(hipCenter, "HipCenter2", 3, TransAxis.Y, false);
            MyBone spine = new MyBone(hipCenter2, JointType.Spine.ToString(), 3, TransAxis.Y, true);
            MyBone shoulderCenter = new MyBone(spine, JointType.ShoulderCenter.ToString(), 3, TransAxis.Y, true);

            MyBone collarLeft = new MyBone(shoulderCenter, "CollarLeft", 3, TransAxis.X, false);
            MyBone shoulderLeft = new MyBone(collarLeft, JointType.ShoulderLeft.ToString(), 3, TransAxis.X, true);
            MyBone elbowLeft = new MyBone(shoulderLeft, JointType.ElbowLeft.ToString(), 3, TransAxis.X, true);
            MyBone wristLeft = new MyBone(elbowLeft, JointType.WristLeft.ToString(), 3, TransAxis.X, true);
            MyBone handLeft = new MyBone(wristLeft, JointType.HandLeft.ToString(), 0, TransAxis.X, true);

            MyBone neck = new MyBone(shoulderCenter, "Neck", 3, TransAxis.Y, false);
            MyBone head = new MyBone(neck, JointType.Head.ToString(), 3, TransAxis.Y, true);
            MyBone headtop = new MyBone(head, "Headtop", 0, TransAxis.None, false);

            MyBone collarRight = new MyBone(shoulderCenter, "CollarRight", 3, TransAxis.nX, false);
            MyBone shoulderRight = new MyBone(collarRight, JointType.ShoulderRight.ToString(), 3, TransAxis.nX, true);
            MyBone elbowRight = new MyBone(shoulderRight, JointType.ElbowRight.ToString(), 3, TransAxis.nX, true);
            MyBone wristRight = new MyBone(elbowRight, JointType.WristRight.ToString(), 3, TransAxis.nX, true);
            MyBone handRight = new MyBone(wristRight, JointType.HandRight.ToString(), 0, TransAxis.nX, true);

            MyBone hipLeft = new MyBone(hipCenter, JointType.HipLeft.ToString(), 3, TransAxis.X, true);
            MyBone kneeLeft = new MyBone(hipLeft, JointType.KneeLeft.ToString(), 3, TransAxis.nY, true);
            MyBone ankleLeft = new MyBone(kneeLeft, JointType.AnkleLeft.ToString(), 3, TransAxis.nY, true);
            MyBone footLeft = new MyBone(ankleLeft, JointType.FootLeft.ToString(), 0, TransAxis.Z, true);

            MyBone hipRight = new MyBone(hipCenter, JointType.HipRight.ToString(), 3, TransAxis.nX, true);
            MyBone kneeRight = new MyBone(hipRight, JointType.KneeRight.ToString(), 3, TransAxis.nY, true);
            MyBone ankleRight = new MyBone(kneeRight, JointType.AnkleRight.ToString(), 3, TransAxis.nY, true);
            MyBone footRight = new MyBone(ankleRight, JointType.FootRight.ToString(), 0, TransAxis.Z, true);

            Skeleton.AddBone(hipCenter);
            Skeleton.AddBone(hipCenter2);
            Skeleton.AddBone(spine);
            Skeleton.AddBone(shoulderCenter);
            Skeleton.AddBone(collarLeft);
            Skeleton.AddBone(shoulderLeft);
            Skeleton.AddBone(elbowLeft);
            Skeleton.AddBone(wristLeft);
            Skeleton.AddBone(handLeft);
            Skeleton.AddBone(neck);
            Skeleton.AddBone(head);
            Skeleton.AddBone(headtop);
            Skeleton.AddBone(collarRight);
            Skeleton.AddBone(shoulderRight);
            Skeleton.AddBone(elbowRight);
            Skeleton.AddBone(wristRight);
            Skeleton.AddBone(handRight);
            Skeleton.AddBone(hipLeft);
            Skeleton.AddBone(kneeLeft);
            Skeleton.AddBone(ankleLeft);
            Skeleton.AddBone(footLeft);
            Skeleton.AddBone(hipRight);
            Skeleton.AddBone(kneeRight);
            Skeleton.AddBone(ankleRight);
            Skeleton.AddBone(footRight);

            Skeleton.FinalizeMySkeleton();
        }
예제 #2
0
 public void copyParameters(MySkeleton input)
 {
     channels = input.Channels;
     maxDepth = input.maxDepth;
     nrBones = input.nrBones;
 }