1

Basically, what I'm trying to do, is store the transform value of an element, manipulate & update it...

I'm looking for some js function-methods that can destructure the matrix3d value into it's initial transform properties.


I've looked into webkitcssmatrix but that's limited and I can't quite figure out the outcome..

this is the briefest explanation I've found on what the matrix3d is:

 [1,0,0,0],
 [0,cos(a), sin(-a), 0],
 [0,sin(a), cos( a), 0],
 [0,0,0,1]

I also found an unmatrix in C (maybe it can be useful...)

Community
  • 1
  • 1
maioman
  • 18,154
  • 4
  • 36
  • 42

1 Answers1

0

It is hard to decompose such matrix because it may be built of many sequential transformations, such as translation, rotation, scaling, skewing, rotation again etc. You may decompose it into basic transformations(which unmatrix.c does) but they might not be initial ones. And there is definitely no built-in function in JavaScript.

If you know there is only one transformation applied and you know what type it is you may decompose matrices as they described here for example.

Freywar
  • 36
  • 3