Transformation of an object

Attention Topic was automatically imported from the old Question2Answer platform.

Okay, I will try to be clear. I am delving into the 2D transformation. I know that the transformation of any 2D object consists of a Base and an origin vector ( or position). The thing I can’t figure out is: if one of the “X and Y axes” of the transformation base is multiplied by a scalar and then it is added to the position of the object, the object moves (example: position + transform.x * 15), but I also know that each of the axes of the base represents the rotation and scaling of the object. This confuses me not a little and I ask why if one of the two axes is implemented for movement like the example above (for this purpose shouldn’t there only be the 2d Transform Origin vector?) in a given direction, shouldn’t it(X or Y axis) just rotate or scale the object?

The rotation and scale is encoded in the `basis` itself, not the “axes” you are referring to. The “axes” are just the columns (or rows, depending on the way `basis` is stored in memory) of `basis`.
The vectors that these columns form, “X” and “Y” are the global directions x and y, but transformed by the rotation and scale of the `basis`. For rotation and scale transforms these vectors are of length 1.
3. Now consider this for an arbitrary rotation, for this you need to know in which global direction your object’s local x axis points. This is exactly what `basis.x` gives you.`basis.y` points to the left of your object, so you’d add that to it’s position if you wanted to make your object move left instead of forward.