Questions About Skinning/Bones
I'm currently implementing a COLLADA loader in Java, and having a bit of an issue regarding the skinning.
First, I have successfully loaded the mesh that will be the skin, as well as the bone heirarchy. (I'm able to render both the mesh and bones (via simple boxes), and it looks correct, although not tied together.
So, my next goal is to bind the skin to the skeleton, but when doing so I'm getting strange results (my character looks like he got caught in some sort of horrible transporter experiment).
My current framework is a scenegraph, with the bones as a Node heirarchy, and the skin just part of the main model node (i.e. not directly tied to the bone).
My question is: What order do I apply the bind_shape_matrix and how are the INV_BIND_MATRIXs used?
Currently, the bind_shape_matrix is applied to the skin mesh one time during initialization, then the offset to the bone and skin mesh vertices are calculated based on the bind_shape_matrix and the INV_BIND_MATRIX for each bone. Which apparently isn't correct. I'm obviously missing a fundamental concept here, and would love any help to work through it.
I'm the artist that is exporting the character for Mark Powell. The only question I have to add to Mark's post it that I'm binding the character to the mesh in Character Studio 4.2. Would this have any bearing on the issue at hand?
The bind_shape_matrix should probably be baked into your geometry data (vertex position, normals, tangents...).
The inverted_bind_pose matrices are used every frame to transform the vertex positions back to the bind pose space. Then, you'll want to transform the vertex positions into world space using the bone's world transformation. There's quite a bit of information around the internet on skinning...
Thanks, the concepts of skinning are well understood, however, the documentation for the 1.4 spec are not. However, through trial and error the matrices were applied correctly and skinning is working now.