If I have two matrices, perhaps representing and object each, how do I retrieve a third matrix which is the difference of the first two.
So if object A moves and rotates I can multiply object A's matrix by my new matrix and get a matrix for object B, object B would then be glued to object A.
I have tried google but I don't really know a good way of asking the question
Let me know if I have not been clear enough and I will try to put it a different way, thanks.
More info:
I am implementing ragdolls for bone animated models,
sometimes there may be a bone which does not need to be simulated(a shoulder perhaps, or fingers).
When the object becomes a ragdoll the bone matrices are all updated by the physics, this works great.
But I need to manually update the bones that are not simulated,
my idea is to glue them to their nearest simulated bone with the correct offset(position and rotation),
gluing is easy enough but I don't know how to find the offset matrix of
one bone relative to the other(eg fingers from the hand).