hi, i´ve tried for a long time to get a skinning example code to work, without much success. does anyone know a website/tutorial where it is described step-by-step what happens to the vertices during key-frame animations? i want to point put that there isnt a more confusing way than wrapping essential pieces of code into class methods, as it is done here:
http://ogldev.atspace.co.uk/www/tutorial38/tutorial38.html
so this one is just not comprehendable, at least not to me ...
i´d like to reiterate what i already know: vertices are defined in "mesh space". to transform that mesh to its proper position in the world, several chained transformations have to be applied to those vertices ("world space"). first, a model is (or can be) a hierarchical organized scene, for example, to put the hand of a human to its correct place, the ellbow-transform and shoulder-transform have to be applied after the models transform itself (that is, where the model in the world is located).
absolute_hand_transform = model_transform x shoulder x ellbow x hand
... each defined relative to its parent, of course. this is all static, no skinning there ... thats what i´ve already implemented.
if you load a model using ASSIMP (for example), bones contain a "offset matrix", that transform the vertices of a mesh to "local space of the bone":
QuoteA mesh may have a set of bones in the form of aiBone structures.. Bones are a means to deform a mesh according to the movement of a skeleton. Each bone has a name and a set of vertices on which it has influence. Its offset matrix declares the transformation needed to transform from mesh space to the local space of this bone.
... then, an animation produces for each bone a relative transformation (relative to its parent, i guess) that i can use (draw) after all the previous or "parent" transforms are applied.
IS IT THEN CORRECT (?) that to draw a skinned mesh, the transformations i have to calculate and send to the vertexshader are calculated as following:
MeshSpace-To-WorldSpace =
ModelToWorld-Transform x
MeshSpace-To-BoneSpace_0 x AnimatedBone_0 x
MeshSpace-To-BoneSpace_1 x AnimatedBone_1 x
MeshSpace-To-BoneSpace_2 x AnimatedBone_2 x
MeshSpace-To-BoneSpace_3 x AnimatedBone_3
where all those "MeshSpace-To-BoneSpace" transforms are these "bone offset matrices" AND each of those "AnimatedBone" are directly computed by interpolating the animation keys ... correct ???
(i assume its not because often i read about having to use some "inverse bone offset transform" in some way i dont get ... ?)
thanks in advance for any answers/suggestions/clarifications !!