Skip to main content
Plane Wryter
Known Participant
November 8, 2021
Question

Translation Matrix: Source(s) for Documentation and Explanation?

  • November 8, 2021
  • 3 replies
  • 1631 views

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:

  • Illustrator CC Scripting Guide, and
  • Adobe Illustrator CC Scripting Reference: Javascript

merely lists these seven properties without definition nor explanation:

  1. Matrix.mValueA
  2. Matrix.mValueB
  3. Matrix.mValueC
  4. Matrix.mValueD
  5. Matrix.mValueTX
  6. Matrix.mValueTY
  7. Matrix.typename

 

Hence this appeal: Where can one find documentation (and explanation) regarding the properties in an Illustrator Translation Matrix?

 

Many, many thanks for the assist!

 

This topic has been closed for replies.

3 replies

Brainiac
November 8, 2021

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. 

schroef
Inspiring
April 21, 2023

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

m1b
Community Expert
November 8, 2021

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

Plane Wryter
Known Participant
November 8, 2021

@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?

  • BTW: The senocular reference is quite obtuse (although I did take Matrix Algebra as an undergrad). After reading it, I remain unclear as to the meaning of the seven properties listed above. Any further insights on their meaning?

Many thanks!

Plane Wryter

CarlosCanto
Community Expert
November 8, 2021

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 abcdtxtyuv, 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

  

CarlosCanto
Community Expert
November 8, 2021

check this page for a great deal of information about Matrices

 

https://www.senocular.com/flash/tutorials/transformmatrix/