Copy link to clipboard
Copied
Where are the properties of an Illustrator "Translation Matrix" object documented and explained?
Attempting to [a] retrieve, then [b] modify, and finally [c] apply a translation(s) to ~2,000 images using Javascript.
What little documentation regarding the composition of the Translation Matrix included in:
merely lists these seven properties without definition nor explanation:
Hence this appeal: Where can one find documentation (and explanation) regarding the properties in an Illustrator Translation Matrix?
Many, many thanks for the assist!
Copy link to clipboard
Copied
check this page for a great deal of information about Matrices
Copy link to clipboard
Copied
Hi @Plane Wryter, small point of clarification: *translation* means moving—you can do that in Illustrator by using the translate() method of a page item.
What you are refering to (as Carlos mentioned) is a *transformation* matrix (or transform matrix). Tranformation includes rotation and skewing as well as translation.
I only mention this because if you actually only want to apply a translation (as your post mentions) you don't need to mess with matrices.
- Mark
Copy link to clipboard
Copied
@CarlosCanto and @m1b, thanks!
@m1b: Thanks for the clarification. I do need to make minor adjustments to dimensions (width & height), rotation, and [re-]scale (all less than 1%).
Can all three parameters be affected by a transformation matrices?
Many thanks!
Plane Wryter
Copy link to clipboard
Copied
the senocular info it's not obtuse at all, you need to read it again, and again until it gets clear
it clearly reads in one of the first paragraphs
"The transformation matrices in Flash that define these affine transformations use a 3 x 3 matrix consisting of 3 rows and 3 columns. The positions of values within this matrix are labeled a, b, c, d, tx, ty, u, v, and w. In matrices, these are known as elements."
it lists the exact same properties Illustrator matrix object uses.
to read, modify and apply a 20 pt translation to a selected rectangle
var idoc = app.activeDocument;
var sel = idoc.selection[0];
var im = app.getIdentityMatrix(); // retrieve
im.mValueTX = 20; // modify
sel.transform (im, true, true, true, true, 1, undefined); // apply
Copy link to clipboard
Copied
but you shouldn't worry about matrix values or use them to do what you need, you can use getScaleMatrix, concatenateRotationMatrix, then concatenate other matrix if you need to, then finally apply that combined transformation matrix, it's all in the Illustrator Reference with samples.
Copy link to clipboard
Copied
The properties in question are the elements of the matrix. For example, the elements of a matrix which rotates a selected item 90 degrees are as follows:
var m = app.getRotationMatrix(90);
alert(m.mValueA + "\t" + m.mValueB + "\n" +
m.mValueC + "\t\t\t" + m.mValueD + "\n" +
m.mValueTX + "\t\t\t" + m.mValueTY);
selection[0].transform(m);
Copy link to clipboard
Copied
The fact is transformation matrixes are a widely used feature in 2D graphics; often used to position every object. I learned from the PostScript Language Reference Manual. So Adobe won't redocument this.
Two ways to think about them
- a magic set of rules for moving, rotating or scaling objects; combine them to make more transformations like shearing.
- a description of 6 of the elements in a 3x3 matrix used to transform positions. The other 3 elements are invariant.
Google should find you a treatment that works for you.
6 of your 7 items are standard matrix elements; the 7th is presumably part of the API needs.
Copy link to clipboard
Copied
Are they actually 3x3 or is it 3x2?
In flash Senocular made a nice infogram with the what is what
What im confused about is how scale and rotation apply to this matrix. I thought it was translate, scale and rotation in the matrix. But its not, its position, skew and scale