Example #1
0
 static XMatrix CreateIdentity()
 {
     XMatrix matrix = new XMatrix();
     matrix.SetMatrix(1, 0, 0, 1, 0, 0, XMatrixTypes.Identity);
     return matrix;
 }
Example #2
0
 internal static XMatrix CreateSkewRadians(double skewX, double skewY)
 {
     XMatrix matrix = new XMatrix();
     matrix.SetMatrix(1, Math.Tan(skewY), Math.Tan(skewX), 1, 0, 0, XMatrixTypes.Unknown);
     return matrix;
 }
Example #3
0
 internal static XMatrix CreateScaling(double scaleX, double scaleY, double centerX, double centerY)
 {
     XMatrix matrix = new XMatrix();
     matrix.SetMatrix(scaleX, 0, 0, scaleY, centerX - scaleX * centerX, centerY - scaleY * centerY, XMatrixTypes.Scaling | XMatrixTypes.Translation);
     return matrix;
 }
Example #4
0
 internal static XMatrix CreateScaling(double scaleX, double scaleY)
 {
     XMatrix matrix = new XMatrix();
     matrix.SetMatrix(scaleX, 0, 0, scaleY, 0, 0, XMatrixTypes.Scaling);
     return matrix;
 }
Example #5
0
 internal static XMatrix CreateRotationRadians(double angle, double centerX, double centerY)
 {
     XMatrix matrix = new XMatrix();
     double sin = Math.Sin(angle);
     double cos = Math.Cos(angle);
     double offsetX = (centerX * (1.0 - cos)) + (centerY * sin);
     double offsetY = (centerY * (1.0 - cos)) - (centerX * sin);
     matrix.SetMatrix(cos, sin, -sin, cos, offsetX, offsetY, XMatrixTypes.Unknown);
     return matrix;
 }
Example #6
0
 internal static XMatrix CreateTranslation(double offsetX, double offsetY)
 {
     XMatrix matrix = new XMatrix();
     matrix.SetMatrix(1, 0, 0, 1, offsetX, offsetY, XMatrixTypes.Translation);
     return matrix;
 }