# Using bone joints

I am trying to save bone joints to a file, and am using this format. I was wondering if anyone could clear up a few questions I have

1. why do I need to provide rotation data for the bone, if I already gave it the location?
2. How do I calculate the rotation of each axis if I have the relative location from the parent joint?

** EDIT **

After doing some more digging, I think that it has something to do with quaternions, so, could someone point me to a good resource on using quaternions for bone joints?

** EDIT AGAIN **

I think I've solved it, but I don't understand how it works. I can't seem to find any google results explaining it. I'd appreciate if anyone could send resources explaining it to me.

-
A complete answer for this question means writing a chapter. Google these terms: skinning, md5 model, bones, skeleton, blending. You need to understand some concepts: hierarchical transformations, bone matrices, pose of an object, orientation quaternion, vertex blending/skinning. Try to understand what a hierarchical transform (parenting) system is first, then post your questions here. – teodron Sep 3 '12 at 15:29
Can you point out the question please? – Maik Semder Nov 2 '12 at 16:28
I guess now that I've done some more research, the question at the time I was posting would have best been "Where is there a good guide on how to use bone joints" – raser Nov 6 '12 at 17:22

1. In the end, bones are just simplified sets of data that generate standard transformation matrices.

Bones have position and orientation in space, they can be scaled, they can be located anywhere and are not necessarily connected to one another. Yet, many approaches to skeletal animation skip some of those possibilities and work with simpler approach where bones could have as little as just rotation and length, or just position and rotation. Other data required to construct transformation matrix is calculated from that and assumptions (e.g. that bones always attach to parent bone, or that rotation is (0,0,0) by default).

2. There are many ways and all of them will be valid. You can set (0,0,0) rotation, or you can set it to point or the next bone in hierarchy, or something else.

From programmers point of view, Euler angles are simpler to code, but from animators point of view, Euler angles are harder to work with and require extra efforts to avoid Gimball locks.

-
@raser Hope that helps, after 3,5 years. ;-) How is your project? – Kromster Feb 16 at 12:17
It's good. I did manage to get something working, but put it on hold about 3 years ago :/ I should release a small demo on GitHub or something so other people can reference it :) – raser Feb 16 at 23:45

I'll tell you what I know about quaternions so far as I'm now attempting my own 3d animation. A quaternion is a combination of a Vector and a Scaler. A Vector are real number components that can represent direction distance or,velocity(i.e. (x,y,z)). A Scaler is a magnitude(distance/length) without an angle. with these you can calculate what you need to know about a particular bones capabilities like rotation and distance.

-