title: How to draw the skeleton from the available coordinates?
body: <p>as i typed in the question, i want to draw the skeletons-line (or draw the line between two points ) from the available coordinates. After drawing, the completed manual-skeleton will look like this. It draw as same as Skeleton Basic did, but the coordinates provided by us.</p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/getfile/425774" rel="nofollow">http://social.msdn.microsoft.com/Forums/getfile/425774</a></p>
  
  <p>I saved the coordinates of joints in a text file and this application will take the data from this file to draw. Can anyone please help me ? I really need it.</p>
  
  <p>I did like this but the skeleton on the screen was freezed, it didn't move follow the coordinates from the text file.</p>
  
  <pre><code>FileStream fs;
      private void Model_DrawBoneAndJoints(ref Skeleton skeleton, DrawingContext drawingContext)
      {
          fs = new FileStream
              (@"C:\Users\PhucTruongTien\Desktop\datagram.txt", FileMode.Open, FileAccess.Read, FileShare.None);
          StreamReader sr = new StreamReader(fs);
          float[] x = new float[20];
          float[] y = new float[20];
  
          SkeletonPoint position;
          Array Joint_Types = Enum.GetValues(typeof(JointType));
          //Joint[] joint_array = new Joint[20];
  
          foreach (JointType j_types in Joint_Types)
          {
              Joint joint = new Joint();
              joint = skeleton.Joints[j_types];
              joint.TrackingState = JointTrackingState.Tracked;
              position = joint.Position;
              position.X = (float)Convert.ToDouble(sr.ReadLine());
              position.Y = (float)Convert.ToDouble(sr.ReadLine());
              position.Z = (float)Convert.ToDouble(sr.ReadLine());
              joint.Position = position;
              skeleton.Joints[j_types] = joint;
          }
  </code></pre>
  
  <p>}</p>
  
  <p>private void DrawBonesAndJoints(Skeleton skeleton, DrawingContext drawingContext)
  {
          Model_DrawBoneAndJoints(ref skeleton, drawingContext);</p>
  
  <pre><code>        //i++;
          // Render Torso
          this.DrawBone(skeleton, drawingContext, JointType.Head, JointType.ShoulderCenter);
          this.DrawBone(skeleton, drawingContext, JointType.ShoulderCenter, JointType.ShoulderLeft);
          this.DrawBone(skeleton, drawingContext, JointType.ShoulderCenter, JointType.ShoulderRight);
          this.DrawBone(skeleton, drawingContext, JointType.ShoulderCenter, JointType.Spine);
          this.DrawBone(skeleton, drawingContext, JointType.Spine, JointType.HipCenter);
          this.DrawBone(skeleton, drawingContext, JointType.HipCenter, JointType.HipLeft);
          this.DrawBone(skeleton, drawingContext, JointType.HipCenter, JointType.HipRight);
  
          // Left Arm
          this.DrawBone(skeleton, drawingContext, JointType.ShoulderLeft, JointType.ElbowLeft);
          this.DrawBone(skeleton, drawingContext, JointType.ElbowLeft, JointType.WristLeft);
          this.DrawBone(skeleton, drawingContext, JointType.WristLeft, JointType.HandLeft);
  
          // Right Arm
          this.DrawBone(skeleton, drawingContext, JointType.ShoulderRight, JointType.ElbowRight);
          this.DrawBone(skeleton, drawingContext, JointType.ElbowRight, JointType.WristRight);
          this.DrawBone(skeleton, drawingContext, JointType.WristRight, JointType.HandRight);
  
          // Left Leg
          this.DrawBone(skeleton, drawingContext, JointType.HipLeft, JointType.KneeLeft);
          this.DrawBone(skeleton, drawingContext, JointType.KneeLeft, JointType.AnkleLeft);
          this.DrawBone(skeleton, drawingContext, JointType.AnkleLeft, JointType.FootLeft);
  
          // Right Leg
          this.DrawBone(skeleton, drawingContext, JointType.HipRight, JointType.KneeRight);
          this.DrawBone(skeleton, drawingContext, JointType.KneeRight, JointType.AnkleRight);
  
          this.DrawBone(skeleton, drawingContext, JointType.AnkleRight, JointType.FootRight);
  
          // Render Joints
          foreach (Joint joint in skeleton.Joints)
          {
              Brush drawBrush = null;
  
              if (joint.TrackingState == JointTrackingState.Tracked)
              {
                  drawBrush = this.trackedJointBrush;
              }
              else if (joint.TrackingState == JointTrackingState.Inferred)
              {
                  drawBrush = this.inferredJointBrush;
              }
  
              if (drawBrush != null)
              {
                  drawingContext.DrawEllipse(drawBrush, null, this.SkeletonPointToScreen(joint.Position), JointThickness, JointThickness);
              }
          }
      }
  </code></pre>
  
  <p>Sorry for my bad english!</p>