Scaling in world space

58 Views Asked by At

In a hierarchical transformation system, where a node has one parent and children (Tree form) I want to scale an object with respect to world space axis. My transformation order is (Translate * Rotate * Scale).

Lets say first I rotate object on three axes 45 degree. Now if I scale on X axis, the object will scale on the 45 degree rotated X axis (Local axis). However I want the scale to occure on world space X axis. To achive this;

Quaternion orientation = Node.GetOrientation();
scale += orientation * scaleFactor * inverse(orientation);

Then when I construct the transformation matrix and apply it

transformation = translation * orientation * scale;

I see that scale occured on all three axes. Y axis shrinks while X axis grows. Somethink wrong with this and I can't find it.