I'm not sure if this is possible, but basically I have two degrees that will change the width/size and skew of an image. In a tranformation matrix (<Matrix3DProjection/>
), it works like this:
M11:cos(x) M12:sin(y)*sin(x) M11:0 M21:0 M22:cos(y) M23:0 M31:0 M32:0 M33:1
So if I have X = 30°
and Y=40°
, my matrix is:
M11:0.866 M12:0.321 M11:0 M21:0 M22:0.766 M23:0 M31:0 M32:0 M33:1
So becomes
What I'd like to use instead is a <TransformGroup/>
but can't quite figure out the <SkewTransform AngleY="???"/>
portion. The <ScaleTransform/>
seems easy enough by using M11 and M22 values above in ScaleX
and ScaleY
like <ScaleTransform ScaleX=".866" ScaleY=".766"/>
.
But I can't figure out the AngleY
portion of <SkewTransform/>
from an M12
value of 0.321. I know that from doinking around with this manually, a value of AngleY="20.3"
seems very accurate. But I can't figure out the math behind this.
Does anyone know?