public void copyParameters(NGESkeleton input) { channels = input.Channels; maxDepth = input.maxDepth; nrBones = input.nrBones; }
public static void AddKinectSkeleton(NGESkeleton Skeleton) { //Die Person steht falsch herum im Koordinatensystem der Kinect! Es wird erst beim Abspeichern korrigiert, weshalb die Verarbeitung noch mit umgekehrten Koordinaten erfolgt NGEBone hipCenter = new NGEBone(null, JointType.HipCenter.ToString(), 6, TransAxis.None, true); NGEBone hipCenter2 = new NGEBone(hipCenter, "HipCenter2", 3, TransAxis.Y, false); NGEBone spine = new NGEBone(hipCenter2, JointType.Spine.ToString(), 3, TransAxis.Y, true); NGEBone shoulderCenter = new NGEBone(spine, JointType.ShoulderCenter.ToString(), 3, TransAxis.Y, true); NGEBone collarLeft = new NGEBone(shoulderCenter, "CollarLeft", 3, TransAxis.X, false); NGEBone shoulderLeft = new NGEBone(collarLeft, JointType.ShoulderLeft.ToString(), 3, TransAxis.X, true); NGEBone elbowLeft = new NGEBone(shoulderLeft, JointType.ElbowLeft.ToString(), 3, TransAxis.X, true); NGEBone wristLeft = new NGEBone(elbowLeft, JointType.WristLeft.ToString(), 3, TransAxis.X, true); NGEBone handLeft = new NGEBone(wristLeft, JointType.HandLeft.ToString(), 0, TransAxis.X, true); NGEBone neck = new NGEBone(shoulderCenter, "Neck", 3, TransAxis.Y, false); NGEBone head = new NGEBone(neck, JointType.Head.ToString(), 3, TransAxis.Y, true); NGEBone headtop = new NGEBone(head, "Headtop", 0, TransAxis.None, false); NGEBone collarRight = new NGEBone(shoulderCenter, "CollarRight", 3, TransAxis.nX, false); NGEBone shoulderRight = new NGEBone(collarRight, JointType.ShoulderRight.ToString(), 3, TransAxis.nX, true); NGEBone elbowRight = new NGEBone(shoulderRight, JointType.ElbowRight.ToString(), 3, TransAxis.nX, true); NGEBone wristRight = new NGEBone(elbowRight, JointType.WristRight.ToString(), 3, TransAxis.nX, true); NGEBone handRight = new NGEBone(wristRight, JointType.HandRight.ToString(), 0, TransAxis.nX, true); NGEBone hipLeft = new NGEBone(hipCenter, JointType.HipLeft.ToString(), 3, TransAxis.X, true); NGEBone kneeLeft = new NGEBone(hipLeft, JointType.KneeLeft.ToString(), 3, TransAxis.nY, true); NGEBone ankleLeft = new NGEBone(kneeLeft, JointType.AnkleLeft.ToString(), 3, TransAxis.nY, true); NGEBone footLeft = new NGEBone(ankleLeft, JointType.FootLeft.ToString(), 0, TransAxis.Z, true); NGEBone hipRight = new NGEBone(hipCenter, JointType.HipRight.ToString(), 3, TransAxis.nX, true); NGEBone kneeRight = new NGEBone(hipRight, JointType.KneeRight.ToString(), 3, TransAxis.nY, true); NGEBone ankleRight = new NGEBone(kneeRight, JointType.AnkleRight.ToString(), 3, TransAxis.nY, true); NGEBone footRight = new NGEBone(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.FinalizeNGESkeleton(); }