I'm working on parsing mdl files for rendering them using opengl. I've already gotten the simple stuff done, vertices, normals, textures, etc. are all being parsed and I can render them correctly.
Right now I'm stuck on the animation. I have several questions and if anyone can help with any of them I'd greatly appreciate it.
I'm updating all of the vertices by:
1. translating them by their pivot point (given by their vertex group)
2. applying the transformation from the attached bone
3. adding back the translation from the pivot point.
The above is probably wrong, so please help if it is...
I guess my first question is what should I be doing when there is more than one matrix for the vertex group? Does this mean that I have to deal with more than one pivot point? Should I apply the same 3 steps above multiple times (once for each matrix entry / bone)?
Also is it true that the position of a pivot point changes as the parent bone/helper is moved/rotated
?
Thanks in advance for any help!
Right now I'm stuck on the animation. I have several questions and if anyone can help with any of them I'd greatly appreciate it.
I'm updating all of the vertices by:
1. translating them by their pivot point (given by their vertex group)
2. applying the transformation from the attached bone
3. adding back the translation from the pivot point.
The above is probably wrong, so please help if it is...
I guess my first question is what should I be doing when there is more than one matrix for the vertex group? Does this mean that I have to deal with more than one pivot point? Should I apply the same 3 steps above multiple times (once for each matrix entry / bone)?
Also is it true that the position of a pivot point changes as the parent bone/helper is moved/rotated
?
Thanks in advance for any help!