I'm trying to create a skeletal animation in opengl. So far the skeleton is working!
The problem is trying to figure out how to skin the mesh.
see? The mesh turns into some kind of bio-experiment using nuclear explosions.
The current way I transform the vertices is as follows:
v = Vector3f.sub(v, j.globalpos, v); //substract global joint pos v = Vector3f.add(v, j.localpos, v); //Add joint offset Quaternion RQ = j.globalrot; //get global rotation (local rotation+parent rots) v = RQ.times(v); //rotation quaternion * vertex position (No weights, just move the anorexic vertex) //v = Vector3f.add(v, j.globalpos, v); //add global joint pos does not work either way
I expected the vertex to go to the skeleton origin + joint offset + offset of vertex compared to the joint pos. (NOTE: the mesh origin is at the same spot as the skeleton origin!) Then I expect it to rotate by the globalrot. Instead its as if the vertex rotates around another origin that isn't correct.
Could someone help me with this?
And yes... I am aware of the seperated vertexes but that is not the problem.
This post has been edited by JL29: 16 January 2013 - 03:04 AM