I'm working on something that uses (an algorithm similar to) texture mapping, for which I want to precalculate the .invert() of a whole bunch of .transform.matrix objects. I'll post something about that in the next coupla days.
Meanwhile, I found something perplexing in the Actionscript documentation but the possibility exists that I am just a dope so please point out an error in my reasoning.
As you may know, you can represent any arbitrary combination of 2-D scalings, skews, rotations and translations using standard matrix operations. The
Actionscript docs for the Matrix class mention this in passing, but has elements .b and .c switched: it should be
and not
.
I whipped up a
MatrixMathDemo in flex to demonstrate the issue:
and a writeup on
Mathematical matrices and the actionscript Matrix transformations [PDF]. The 2d, 3d, 4th tabs compare the Matrix methods concat(), invert() and (deltaP/p)ointTransform() respectively with an explicit calculation of the corresponding Matrix operation: they show that in fact the documentation has
b and
c switched. (The code is
free to reuse or modify (but give credit) in case that's useful.)
Some references:
Labels: actionscript, adobe, concat, error, flex, invert, Mathematics, matrices, matrix, rotate, scale, shear, transform, translate