UnsafeNativeMethods.Matrix.AffineTransformation2D(Matrix,Single,Vector2,Single,Vector2) Method (Microsoft.DirectX)
Builds a 2-D affine transformation matrix in the xy plane.
Note: For programming in Microsoft Visual Basic .NET or Microsoft JScript .NET, use the equivalent method in the Microsoft.DirectX structures.
Definition
Visual Basic Public Shared Function AffineTransformation2D( _
ByVal pOut As Matrix, _
ByVal scaling As Single, _
ByVal rotationCenter As Vector2, _
ByVal rotation As Single, _
ByVal translation As Vector2 _
) As MatrixC# public static Matrix AffineTransformation2D(
Matrix pOut,
float scaling,
Vector2 rotationCenter,
float rotation,
Vector2 translation
);C++ public:
static Matrix AffineTransformation2D(
Matrix pOut,
float scaling,
Vector2 rotationCenter,
float rotation,
Vector2 translation
);JScript public static function AffineTransformation2D(
pOut : Matrix,
scaling : float,
rotationCenter : Vector2,
rotation : float,
translation : Vector2
) : Matrix;
Parameters
pOut Microsoft.DirectX.Matrix
A Matrix structure that is an affine transformation matrix.scaling System.Single
Scaling factor. A value of zero indicates no scaling.rotationCenter Microsoft.DirectX.Vector2
A Vector2 structure that represents a point identifying the center of rotation. Use an empty Vector2 for no rotation.rotation System.Single
Angle of rotation. A value of zero indicates no rotation.translation Microsoft.DirectX.Vector2
A Vector2 structure that represents the translation. Use Vector2.Empty to specify no translation.
Return Value
Microsoft.DirectX.Matrix
A Matrix structure that is an affine transformation matrix.
Remarks
The AffineTransformation2D method calculates the affine transformation matrix using the following formula, with matrix concatenation evaluated in left-to-right order.
Mout = Ms * (Mrc)-1 * Mr * Mrc * Mt
where:
- Mout = output matrix (pOut)
- Ms = scaling matrix (scaling)
- Mrc = center of rotation matrix (rotationCenter)
- Mr = rotation matrix (rotation)
- Mt = translation matrix (translation)
The return value for this method is the same value returned in the pOut parameter. This allows you to use the AffineTransformation2D method as a parameter for another method.
See Also