   Problem building joint offsets in skeleton
  Just in case: this is not homework... I'm working on a hobby project and I'm quite bad at math...So, I have a list of joints in a skeleton (stored as a text file), one joint per line, the following way : Xjoint, Yjoint, Zjoint, ParentIndex (-1 means it's the root)example:-0.0932343 8.90962 0.311302 -1-0.011616 6.50475 0.0086496 0-0.0141455 5.34361 -0.00196868 1-0.0926573 11.8344 0.315253 0-0.326239 5.3348 0.00621673 2-1.46522 3.49112 0.00890759 4-2.73905 0.95607 -0.0975711 5-2.66168 0.544972 0.675064 60.275035 5.35378 -0.0202439 21.5008 3.48776 0.0243491 82.72164 0.858362 -0.0920669 92.65324 0.524069 0.662963 10-1.2826 8.67741 0.169085 0-3.14764 8.31355 0.255965 12-4.57706 7.22451 0.832647 131.00479 8.92407 0.756222 03.29614 8.24354 0.255188 154.64206 7.20136 0.942187 16The Xjoint, Yjoint, Zjoint are Absolute positions (relative to the origin (0,0,0)). How can I convert them to relative offsets. (I use the irrlich engine which stores joints as Local Matrices).How could I go about converting the Absolute coorinates into relative offsets?I've tried to come up with something but the skeleton comes out upside-down and heavily scaled (arms longer than feet, etc...) I've marked correct world positions are marked with small spheres so I know that there must be something wrong with my translations.   
  I'll assume you use some kind of tree-structure to represent the joints and theirs parents.You should have something like(this isn't the bone hierarchy in your post)ROOT| \ 1 4  5| |\ 2 6 7|3Now, to calculate relative offsets, start at the leaves and calculate their offset based on their parent:node3.relativePosition = node3.absolutePosition - node2.absolutePositionnode2.relativePosition = node2.absolutePosition - node1.absolutePosition...Whenever you get to a node that has more than one child, go through that branch and repeat the process at its leaves. You should be able to write a simple recursive algorithm to calculate their offsets. Note that the root joint is already in a relative offset to it's "parent", the origin.   ;  Thanks a lot. Obviously, it worked.Turns out I can be quite a moron at times. :DTo think I tried matrix multiplication and even thought of usinga local vector space :(.Now on to weights and ... well, everything else!   