Transformation: keep scale vector in the chain ?


i get weird results. currently i have the following:

struct CTransformation {
    vec3 Position = vec3(0, 0, 0);
    quat Rotation= quat (1, 0, 0, 0);
    vec3 Size = vec3(1, 1, 1);

    mat4 Matrix () const { return translate(Position) * toMat4(Rotation) * scale(Size ); }

i’ve read that if i keep the scale vector in the transform matrix, then i can scale whole models with just 1 matrix applied. the problem is when i have skeletons made up of several meshes with each a separate scale matrix, then the result looks not as it looks like in blender.

is it wrong to keep the “vec3 Size;” within the transform matrix ?
should i instead keep it in a separate variable to only scale each mesh of the current node with it ?
i’m confused because assimp doesnt structure it like that …

Why would you need to scale different skeleton meshes with different factors ?

Assimp is not a model, just a ‘little’ library, which, from the uses I made with it, has a lot of issues. Assimp is useful to easily load some stuffs, but it will never replace your own implementation once you want something really deeply adapted to your own soft. For example, fbx import is really bad and I often have very bad meshes with it. For 3ds, it tends to create far more meshes than with using lib3ds. For obj, depending on its version meshes might not be named…

For the difference you can encounter with other softs: If Blender does a separate scale (nothing within the mv matrix), then it can apply it before the ‘normal’ transformations (translation, rotations) or after. So if you want something that is the same as blender you should apply the transformation matrices (including the scales) exactly in the same order than blender.