Original Post
I'm having trouble animating the joints.
Given the following:
I create a chain of matrices from the bindpose_joints::local_position :
and that looks fine when I render it (skeleton standing with arms out to the side with all of the joints in the right place in object space).
However, when I try to do the exact same thing with the joints in frame X (creating a chain of matrices out of animation_joint::local_position), all of frame X's joints are around the origin.
Is this the correct way to animate joints/bones? Do I need to multiply bindpose_joint's data with the animation_joint's? Or is the frame data just incorrect (all the animation_joint::local_position components are near zero)? Or am I just interpreting the frame joint data incorrectly?
Given the following:
struct bindpose_joint{ int parent, sibling, child; // // vec4 world_rotation; // vec4 world_position; // // vec4 local_rotation; // <--- all of these were given from source file vec4 local_position; // vec4 local_scale; // mat4x4 final_transform; // <--- I added this};struct animation_joint{ vec4 local_rotation; // vec4 local_position; // <--- all of these were given from source file vec4 local_scale; //};animation_joint frames[numframes][numjoints];I create a chain of matrices from the bindpose_joints::local_position :
mat4x4 transl = mat4x4(childjoint.local_position);childjoint.final_transform = parentjoint.final_transform * transl;and that looks fine when I render it (skeleton standing with arms out to the side with all of the joints in the right place in object space).
However, when I try to do the exact same thing with the joints in frame X (creating a chain of matrices out of animation_joint::local_position), all of frame X's joints are around the origin.
Is this the correct way to animate joints/bones? Do I need to multiply bindpose_joint's data with the animation_joint's? Or is the frame data just incorrect (all the animation_joint::local_position components are near zero)? Or am I just interpreting the frame joint data incorrectly?