You should get familiar with linear algebra. This becomes a fairly trivial with vectors and matrices.

Each bone can simply be defined as having location in the coordinate frame of its parent bone and a transformation that this bone applies. That will uniquely define the entire bone structure. In addition to that, you can add any information you want to the bones, of course.

Your choice of bone names is a little bit off for the sake of explaining the situation and to extend the explanation to more bones, so let's say instead that bone A is the first bone, bone B is attached to bone A, and bone C is attached to bone B, and so on. Each bone has a positionp(a vector) and an orientationR(a rotation matrix). Let's say that each bone also has a translation matrixTthat simply corresponds to a translation matrix by its positionp. For example, A.Ris the rotation matrix of bone A, and B.Tis the translation matrix for bone B, and so on.

At this point, finding the orientation and location of any bone in an arbitrary chain of bones becomes fairly trivial. To determine a bone's parent transformations, you simply multiply all its parent transformations.

- The bone A is the parent bone and is thus not subject to any prior transformations. Its location is A.
pand its orientation is A.R, so you can use these matrices to draw the bone itself.- The bone B has the bone A as its parent. Its location is B.
pin A's coordinate frame, and so its location becomes (A.T* A.R) * B.p.- The bone C has the bone B as its parent. Its location is C.
pin B's coordinate frame, and so its location becomes ((A.T* A.R) * B.T* B.R) * C.p.- The bone D has the bone C as its parent. Its location is D.
pin C's coordinate frame, and so its location becomes (((A.T* A.R) * B.T* B.R) * C.T* C.R) * D.p.- And so on...
In your case, you would have defined the bones as follows:

- A.
p= (0,0,30)- A.
R= rotation matrix of 45 degrees- B.
p= (0,0,15)- B.
R= rotation matrix of 0 degreesNote that bone B (which is bone A in your picture) does not have any rotation on its own; its rotation comes from its parent bone A (bone B in your picture).

Note that, depending on which conventions you choose for your linear algebra, you may have to change the order of the translation and the rotation matrices, multiply child bones on the left side, and/or multiply the position vector on the left side instead.

Ok thanks for the info,Trying Linear Algebra now thanks.

EDIT:it's now make sense,I'm learning from it thanks....