   How to Draw Skeleton?
  Hello,This is my system:http://www.gamedev.net/community/forums/topic.asp?topic_id=533640 (Posted - 5/3/2009 3:39:24 AM)How can i draw a skeleton? (in any api)Thanks,Kasya   
  Transform Vector(0,0,0,1) by all your bone matrices, this will generate a point cloud where all your bones start. You may need an extra point for your end effector. It'll depend on what axis it's aligned to, maybe Vector(0,0,1,1) will suit you.Then you just render lines between the points. Alternatively you can use a bone model, and just use the bone transform as the model transform. Render the model in each bone location.   ;  I want to know one thing?Is that correct to use rotation in Rendering?void RenderSkeleton() {glBegin(GL_LINES);RenderBone(root);glEnd();}void RenderBone(Bone * bone) {Matrix trans, rot, final;trans.Translate(position);orientation.ToMatrix(rot);final = (trans * rot);glVertex3f(final.getTranslate().x, final.getTranslate().y, final.getTranslate().z);for(bone in children /* This is not c++ :) */) {RenderBone(bone);}}Will that be correct?Thanks,Kasya   ;  yes, except the last bone's orientation will not be visible. For example, if your wrist was the last bone in your arm chain, the last vertex will be placed at the wrist, not indicating the orientation of the wrist, only the position. You'll need to draw another point where the next bone would be, such as the tip of your fingers. If your hand is in the local Z direction of the wrist bone, then transforming Vector(0,0,x,1) by the wrist bone will give you the last vertex to draw. Where x is the length of the last line segment to draw.void RenderBone(Bone * bone) { Matrix trans, rot, final; trans.Translate(position); orientation.ToMatrix(rot); final = (trans * rot); glVertex3f(final.getTranslate().x, final.getTranslate().y, final.getTranslate().z); if (children.size() == 0) {  const float lastSegLength = 2;  Vector lastSeg = final * Vector(0,0,lastSegLength,1);  glVertex3f(lastSeg.x, lastSeg.y, lastSeg.z);   } else {  for(bone in children /* This is not c++ :) */) {    RenderBone(bone);  } }}