Share via


Matrix.Transformation2D(Vector2,Single,Vector2,Vector2,Single,Vector2) Method (Microsoft.DirectX)

Builds a 2-D transformation matrix in the xy plane.

Definition

Visual Basic Public Shared Function Transformation2D( _
    ByVal scalingCenter As Vector2, _
    ByVal scalingRotation As Single, _
    ByVal scaling As Vector2, _
    ByVal rotationCenter As Vector2, _
    ByVal rotation As Single, _
    ByVal translation As Vector2 _
) As Matrix
C# public static Matrix Transformation2D(
    Vector2 scalingCenter,
    float scalingRotation,
    Vector2 scaling,
    Vector2 rotationCenter,
    float rotation,
    Vector2 translation
);
C++ public:
static Matrix Transformation2D(
    Vector2 scalingCenter,
    float scalingRotation,
    Vector2 scaling,
    Vector2 rotationCenter,
    float rotation,
    Vector2 translation
);
JScript public static function Transformation2D(
    scalingCenter : Vector2,
    scalingRotation : float,
    scaling : Vector2,
    rotationCenter : Vector2,
    rotation : float,
    translation : Vector2
) : Matrix;

Parameters

scalingCenter Microsoft.DirectX.Vector2
A Vector2 structure that is a point identifying the scaling center.
scalingRotation System.Single
Scaling rotation factor. Use a zero value to specify no rotation.
scaling Microsoft.DirectX.Vector2
A Vector2 structure that is a point identifying the scale. Use Vector2.Empty to specify no scaling.
rotationCenter Microsoft.DirectX.Vector2
A Vector2 structure that is a point identifying the rotation center.
rotation System.Single
Angle of rotation, in radians.
translation Microsoft.DirectX.Vector2
A Vector2 structure that identifies the translation. Use Vector2.Empty to specify no translation.

Return Value

Microsoft.DirectX.Matrix
A Matrix structure that contains the transformation matrix.

Remarks

The Transformation2D method calculates the affine transformation matrix using the following formula, with matrix concatenation evaluated in left-to-right order:

M out = (Msc)-1 * (Msr)-1 * Ms * Msr * Msc * (Mrc)-1 * Mr * Mrc * Mt

where:

  • M out = output transformation matrix (the return value)
  • M sc = scaling center matrix (scalingCenter)
  • M sr = scaling rotation matrix (scalingRotation)
  • M s = scaling matrix (scaling)
  • M rc = center of rotation matrix (rotationCenter)
  • M r = rotation matrix (rotation)
  • M t = translation matrix (translation)

For 3-D transformations, use Transformation.