I am trying to add animation to my program.
I have a human model created in Blender with skeletal animation, and I can skip keyframes to see how the model goes.
Now I exported the model to XML format (Ogre3D), and in this XML file I see how rotation, translation, and scale are assigned to each bone at a specific time (t = 0.00000, t = 0,00040, ..., etc. d.)
What I did was find which vertices are assigned to each bone. Now I assume that all I have to do is apply the bone-specific transforms to each of these vertices. Is this the right approach?
In my OpenGL function draw () (rough pseudocode):
for (Bone b : bones){ gl.glLoadIdentity(); List<Vertex> v= b.getVertices(); rotation = b.getRotation(); translation = b.getTranslation(); scale = b.getScale(); gl.glTranslatef(translation); gl.glRotatef(rotation); gl.glScalef(scale); gl.glDrawElements(v); }
opengl skeletal-animation
Martin Konecny
source share