ART.Transform lets you manipulate ART objects by moving, scaling and rotating them.
You can also use a custom homogeneous transformation matrix to create advanced transforms.
ART.Shape implements ART.Transform as a mixin which means it has all ART.Transform methods available.
This documentation refers to the “origin”. This refers to the 0,0 coordinate in a shape or group. Often the top left corner.
Typically you won’t use this constructor yourself. Instead, you’ll use the methods as they’re implemented on shapes or groups.
var transform = new ART.Transform([xx, yx, xy, yy[, x, y]]);
The arguments correspond to the following homogeneous transformation matrix:
xx xy x
yx yy y
0 0 1
The default transformation is the identity matrix:
1 0 0
0 1 0
0 0 1
var transform = new ART.Transform(transform);
Modifies the current transform by multiplying the current values with some new values. This method can be used to create complex transformations. Typically you won’t use this method yourself but rather one of the other convenient methods.
Note: The order of which multiplied transforms are applied is significant.
instance.transform(xx, yx, xy, yy[, x, y]);
The arguments correspond to the following matrix multiplication:
result current arguments
xx xy x xx xy x xx xy x
yx yy y = yx yy y * yx yy y
0 0 1 0 0 1 0 0 1
instance.transform(transform);
Resets the transform to some new values. This method has the same arguments as the constructor.
This is typically used to reset the transform of a shape to some absolute value.
instance.transformTo([xx, yx, xy, yy[, x, y]]);
instance.transformTo([transform]);
Moves the origin x/y units in the horizontal/vertical direction.
transform.move(x, y);
Moves the origin to an absolute point.
transform.moveTo(x, y);