first of all i would like to say that i read everything out there and still did not figure it out quite yet.
In my project i need to implement a skinning technique, but before going there i need to get the standar Linear Blend Skinning working.
I'm using assimp to load my model. For testing purposes my model is a cylindre with a single mesh and 2 bones. There are no animations, the goal of my demo is to manually move the bones.
I read every tutorial/article outhere about assimp and skeletal animation. So i think i got the loading part right. I got the mTransformation from the nodes and got the offsetMatrix from the meshes with the same name (i used a map to store the bones/names).
i did some printing to verify my structure and i'm loading the correct info, i'm getting identity matrices everywhere (wich i think is normal since there is no animation and it's just a simple mesh).
The part i could not figure out still , is how i apply these transformations to my vertices. This point affects the loading too ,when i apply a scale/translation on a mesh in blender i can't get it in my renderer.
in my bones i store 2 matrices and i have a third one that represents the final transformation. I did not understand how i would compute this one, i saw some people using and inverse of the root transform and i have a hard time coding something i don't understand.
struct Weights
{
uint vertexID;
float weight;
};
struct Bone
{
Bone():parent(nullptr){}
~Bone()
{
for(auto p: children)
delete p;
}
std::string name; // bone name
QMatrix4x4 nodeTransform; //Transformation of the node
QMatrix4x4 offsetMatrix; // Going into the bone's space
QMatrix4x4 finalTransfrom; // where we store the final transfrom
QVector<Weights> boneWeights; // bone wheights
Bone *parent; // pointer to the parent node nullptr if root
QVector<Bone*> children; // storing pointers to the children
};
thank you for help !