An MTransformationMatrix allows the manipulation of the individual transformation components (eg scale, rotation, shear, etc) of a four by four transformation matrix.
The transformation in the node is represented as a 4x4 transformation matrix. This class allows access to the whole matrix, or the individual components (eg scale, rotation, shear, etc) of the transformation. This breakdown provides animators fine control over the animation of these parameters. Therefore, it is necessary to describe the order in which these attributes are applied to build the final matrix attribute.
A transformation matrix is composed of the following components:
Note that the default RotationOrder is kXYZ.
The matrices are post-multiplied in Maya. For example, to transform a point P from object-space to world-space (P') you would need to post-multiply by the worldMatrix. (P' = P x WM)
The transformation matrix is then constructed as follows:
-1 -1 [Sp]x[S]x[Sh]x[Sp]x[St]x[Rp]x[Ro]x[R]x[Rp]x[Rt]x[T]
where 'x' denotes matrix multiplication and '-1' denotes matrix inversion
Sp = | 1 0 0 0 | St = | 1 0 0 0 | | 0 1 0 0 | | 0 1 0 0 | | 0 0 1 0 | | 0 0 1 0 | | spx spy spz 1 | | sptx spty sptz 1 | S = | sx 0 0 0 | Sh = | 1 0 0 0 | | 0 sy 0 0 | | shxy 1 0 0 | | 0 0 sz 0 | | shxz shyz 1 0 | | 0 0 0 1 | | 0 0 0 1 | Rp = | 1 0 0 0 | Rt = | 1 0 0 0 | | 0 1 0 0 | | 0 1 0 0 | | 0 0 1 0 | | 0 0 1 0 | | rpx rpy rpz 1 | | rptx rpty rptz 1 | Ro = AX * AY * AZ AX = | 1 0 0 0 | AY = | cy 0 -sy 0 | | 0 cx sx 0 | | 0 1 0 0 | | 0 -sx cx 0 | | sy 0 cy 0 | | 0 0 0 1 | | 0 0 0 1 | AZ = | cz sz 0 0 | sx = sin(rax), cx = cos(rax) | -sz cz 0 0 | sy = sin(ray), cx = cos(ray) | 0 0 1 0 | sz = sin(raz), cz = cos(raz) | 0 0 0 1 | R = RX * RY * RZ (Note: order is determined by rotateOrder) RX = | 1 0 0 0 | RY = | cy 0 -sy 0 | | 0 cx sx 0 | | 0 1 0 0 | | 0 -sx cx 0 | | sy 0 cy 0 | | 0 0 0 1 | | 0 0 0 1 | RZ = | cz sz 0 0 | sx = sin(rx), cx = cos(rx) | -sz cz 0 0 | sy = sin(ry), cx = cos(ry) | 0 0 1 0 | sz = sin(rz), cz = cos(rz) | 0 0 0 1 | T = | 1 0 0 0 | | 0 1 0 0 | | 0 0 1 0 | | tx ty tz 1 |
Description
Class Constructor.
Description
Class Copy Constructor.
Arguments
Description
Class Constructor.
Arguments
Class Destructor.
Description
Copy operator.
Arguments
Description
Copy operator.
Arguments
Return Value
Description
Returns the four by four matrix that describes this transformation
Return Value
Description
Returns the inverse of the four by four matrix that describes this transformation.
Return Value
Returns scale space matrix. The scale space matrix takes points from object space to the space immediately following scale and shear transformations.
Return Value
Returns rotate space matrix. The rotate space matrix takes points from object space to the space immediately following the scale/shear/rotation transformations.
Return Value
Returns a matrix that represents the specified percentage of this transformation matrix.
Arguments
Return Value
Set the scale component of the transformation matrix.
Arguments
Return Value
Status Codes
Get the scale component of the transformation matrix.
Arguments
Return Value
Status Codes
Add to the scale component by scaling relative to the existing transformation.
Arguments
Return Value
Status Codes
Description
Returns the rotation component of the transformation matrix as a quaternion. The rotation is returned in MSpace::kTransform space.
Return Value
Description
Sets the rotation component of the transformation matrix using a quaternion. The rotation is performed in MSpace::kTransform space.
Arguments
Return Value
Description
Adds to the rotation component of the rotation matrix by rotating relative to the existing transformation using a quaternion. The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kPreTransform/MSpace::kObject. All other spaces are treated as being equivalent to MSpace::kTransform.
Arguments
Return Value
Status Codes
Description
Returns the rotation component of the transformation matrix as an euler rotation.
Return Value
Description
Sets the rotation component of the transformation matrix using an euler rotation. The rotation is performed in MSpace::kTransform space.
Arguments
Return Value
Description
Adds to the rotation component of the rotation matrix by rotating relative to the existing transformation using an euler rotation. The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kPreTransform/MSpace::kObject. All other spaces are treated as being equivalent to MSpace::kTransform.
Arguments
Return Value
Status Codes
Get the rotation component of the transformation matrix as a quaternion. The rotation is retrieved in MSpace::kTransform space.
Arguments
Return Value
Status Codes
Description
Set the rotation component of the transformation matrix using a quaternion. The rotation is set in MSpace::kTransform space.
Arguments
Return Value
Status Codes
Add to the rotation component by rotating relative to the existing transformation. Rotation is a quaternion. The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kPreTransform. All other spaces are treated as being equivalent to MSpace::kTransform.
Arguments
Return Value
Status Codes
Description
Get the rotation component of the transformation matrix in radians. The rotation is retrieved in MSpace::kTransform space.
Arguments
Return Value
Status Codes
Description
Set the rotation component of the transformation matrix. The rotation is set in MSpace::kTransform space.
Arguments
Return Value
Status Codes
Add to the rotation component by rotating relative to the existing transformation. The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kPreTransform. All other spaces are treated as being equivalent to MSpace::kTransform.
Arguments
Return Value
Status Codes
Returns the rotation order for the transform matrix. That is the order in which the Euler angles are applied to create the end rotation.
Arguments
Return Value
Status Codes
Reorders the x, y, and z components of the rotation of this transform. The overall rotation will remain the same. This operation is not unique, so spin information will be lost.
Arguments
Return Value
Status Codes
Sets the rotation given an axis and a rotation about it.
Arguments
Return Value
Status Codes
Description
Returns the rotation orientation for the transformation matrix. The rotation orientation is the rotation that orients the local rotation space. The rotation is returned in MSpace::kTransform space.
Return Value
Description
Sets the rotation orientation for the transformation matrix. The rotation orientation is the rotation that orients the local rotation space. The rotation is set in MSpace::kTransform space.
Return Value
Set the translation component of the transformation matrix in centimeters.
Arguments
Return Value
Status Codes
Returns the translation component of the translation as a vector in centimeters.
Arguments
Return Value
Status Codes
Add to the translation component by translating relative to the existing transformation.
Arguments
Return Value
Status Codes
Set the shear component of the transformation matrix. The shear values represent (xy, xz, yx).
Arguments
Return Value
Status Codes
Get the shear component of the transformation matrix.
Arguments
Return Value
Status Codes
Add to the shear component by shearing relative to the existing transformation.
Arguments
Return Value
Status Codes
Set the pivot around which the scale is applied.
If balance if true, then the overall transformation matrix will not change and a compensating transformation will be added to the scale transformation to achieve this.
Arguments
Return Value
Status Codes
Returns the pivot around which the scale is applied.
Arguments
Return Value
Status Codes
Set the pivot translation. This component is used to preserve existing scale transformations when moving pivot. This method will only be useful to advanced users.
Arguments
Return Value
Status Codes
Returns the scale pivot translation. This is the translation that is used to compensate for the movement of the scale pivot.
Arguments
Return Value
Status Codes
Set the pivot around which the rotation is applied.
If balance if true, then the overall transformation matrix will not change and a compensating transformation will be added to the rotation transformation to achieve this.
Arguments
Return Value
Status Codes
Returns the pivot around which the rotation is applied.
Arguments
Return Value
Status Codes
Set the pivot translation. This component is used to preserve existing transformations when moving pivot. This method will only be useful to advanced users.
Arguments
Return Value
Status Codes
Returns the rotation pivot translation. This is the translation that is used to compensate for the movement of the rotation pivot.
Arguments
Return Value
Status Codes
Returns true if this transform matrix is equivalent to the one passed in within a certain tolerance.
Arguments
Return Value
Equality operator.
Arguments
Return Value
Inequality operator.
Arguments
Return Value
Description
THIS IS AN OBSOLETE METHOD
This method will be removed in a future Maya release. The transformation space argument was always treated as MSpace::kTransform regardless of the actual argument. Please use the other MTransformationMatrix::getRotation method for equivalent functionality.
Get the rotation component in radians of the transformation matrix.
Arguments
Return Value
Status Codes
Description
THIS IS AN OBSOLETE METHOD
This method will be removed in a future Maya release. The transformation space argument was always treated as MSpace::kTransform regardless of the actual argument. Please use the other MTransformationMatrix::setRotation method for equivalent functionality.
Set the rotation component of the transformation matrix.
Arguments
Return Value
Status Codes
Description
THIS IS AN OBSOLETE METHOD
This method will be removed in a future Maya release. The transformation space argument was always treated as MSpace::kTransform regardless of the actual argument. Please use the other MTransformationMatrix::getRotationQuaternion method for equivalent functionality.
Get the rotation component of the transformation matrix as a quaternion.
Arguments
Return Value
Status Codes
Description
THIS IS AN OBSOLETE METHOD
This method will be removed in a future Maya release. The transformation space argument was always treated as MSpace::kTransform regardless of the actual argument. Please use the other MTransformationMatrix::setRotationQuaternion method for equivalent functionality.
Set the rotation component of the transformation matrix using a quaternion.
Arguments
Return Value
Status Codes
© 1997-2004 Alias. All rights reserved. | doc++ Copyright |