Decompose 2D Transformation Matrix

后端 未结 3 906
余生分开走
余生分开走 2021-01-03 09:49

So, I have a Direct2D Matrix3x2F that I use to store transformations on geometries. I want these transformations to be user-editable, and I don\'t want the user

3条回答
  •  走了就别回头了
    2021-01-03 10:35

    Store the primary transformations in a class with editable properites

       scaling
       rotation
       skewing
       translation
    

    and then build the final transform matrix from those. It will be easier that way. However if you must there are algorithms for decomposing a matrix. They are not as simple as you might think.

    System.Numerics has a method for decomposing 3D transform matrices

    https://github.com/dotnet/corefx/blob/master/src/System.Numerics.Vectors/src/System/Numerics/Matrix4x4.cs#L1497

提交回复
热议问题