Hi, my name is Vitor. I’m currently writting an package to provide support for flash SWF files. One of the main problems is about the transformation matrix. Flash and other vector-like 2D shapes uses 2x3 matrixes, and i really want to convert it to the default Unity’s Transform. After some hardwork, i got this convertion method:
Then, i convert to Transform using the infos provided by this thread:
How to assign Matrix4x4 to Transform?
The Translate and Scale looks great. But the skewing logicaly doesn’t work. As i can see, to reach the visual effect of skewing, i need to perform some 3D rotation + scaling.
I can’t found on entire Google nothing about this crazy situation. Thanks for hellping ^^
Well, your conversion is correct. What exact issue do you have? Note that the “extraction” of translation, rotation and scale on that other thread you’ve linked does not work in all cases since the combination of multiple matrices can perform operations that are not just rotation, translation or scale. One of such operations is a shear operation ^^.
A shear can be achieved in Unity but only with multiple GameObjects and non uniform scaling in the parent. However a shear can not be achieved with a single Transform. That’s because a Transform component represents a position, rotation and scale seperately. It does not store a matrix internally. So it can not represent a shear transformation.
The question is what or where do you need this transform specifically? For rendering you should be able to use Graphics.DrawMesh and specify your own matrix.