Not really sure where to put this, I think we need a general 3d graphics or opengl forum... well this will do for now.
I'm writing an md3 loader/renderer and I've come to a problem when it comes to attaching separate model pieces. I'm hoping someone who has used md3s before can help me, but first some review on the issue: md3s use something called 'tags' to attach separate model pieces, generally the pieces are: head, torso, and legs but could be anything I assume. Each model part has a set of tags, each of which has a name that specifies what model part the tag effects. The tag itself stores a position and orientation (as a 3x3 matrix). Its my understanding that if a model part has a tag with a name specifying another piece, than that other piece's position and orientation are always dependant on the piece with the tag.
The part I'm having trouble with is keeping the pieces synced together. I know how to transform the pieces according to the matrix and translate them into place, but I don't understand how I can update the pieces when the 'controller' piece animates. For example, there is a 'torso' model part with a tag: tag_weapon and there is a weapon model part. When the torso (which actually makes up the midsection and both arms of the model) animates, the arms move up and down and the gun should stay oriented relative to the position of the right hand. I don't understand how I can detect the change in the torso's position and orientation in order to update the pieces which are dependant on it. The problem seems even more complex since the gun should really be positioned relative to the hand (which is a part of the torso), but the weapon is only attached to the torso piece, the file itself says nothing about the model's hand.
This is the sort of problem that makes me think I'm missing something big because I just see no solution. Is there some other part to the md3 format that gives more info about how these various pieces are connected? or maybe I'm supposed to calculate the change in position and orientation of model parts in order to apply it to its dependancies? I have seen this model animated correctly with another program, so the file itself (or files rather) is valid. Hopefully someone can give me some insight