| Customize Help
| Save Settings

M3dgeoMatrixSetTransform



Function Map
Synopsis
Set the transformation values of a transformation matrix object.
Syntax
void M3dgeoMatrixSetTransform(
MIL_ID Matrix3dgeoId, //in
MIL_INT64 TransformType, //in
MIL_DOUBLE Param1, //in
MIL_DOUBLE Param2, //in
MIL_DOUBLE Param3, //in
MIL_DOUBLE Param4, //in
MIL_INT64 ControlFlag //in
)
Description

This function assigns a transformation to a transformation matrix object or composes a transformation with a transformation matrix object. The transformation can be defined as a translation, rotation, scale, or the result of a matrix composition.

Note that all angles should be given in degrees. However, unlike most other MIL functions, angles are interpreted using the right-hand grip rule around the axis of rotation; if you wrap your right hand around the axis of rotation, pointing your thumb in the positive direction of the axis, your fingers wrap in the direction of rotation. For example, a positive rotation around the Z-axis corresponds to a rotation that turns the positive X-axis toward the positive Y-axis.

All coordinates are expressed in world units in the working coordinate system.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
Matrix3dgeoId

Specifies the identifier of the transformation matrix object. The transformation matrix object must have been previously allocated using M3dgeoAlloc() with M_TRANSFORMATION_MATRIX.

TransformType

Specifies the type of transformation to apply.

See the Parameter associations section for possible values that can be specified.

Param1

Specifies the first parameter used to define the transformation matrix.

See the Parameter associations section for possible values that can be specified.

Param2

Specifies the second parameter used to define the transformation matrix.

Set this parameter to M_DEFAULT if not used.

See the Parameter associations section for possible values that can be specified.

Param3

Specifies the third parameter used to define the transformation matrix.

Set this parameter to M_DEFAULT if not used.

See the Parameter associations section for possible values that can be specified.

Param4

Specifies the fourth parameter used to define the transformation matrix.

Set this parameter to M_DEFAULT if not used.

See the Parameter associations section for possible values that can be specified.

ControlFlag

Specifies how to apply the transformation.

function map For specifying how to apply the transformation
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_ASSIGN.

Click to summarize M_ASSIGN

Specifies to assign the specified transformation to the given transformation matrix object.

Click to summarize M_COMPOSE_WITH_CURRENT

Specifies to compose the specified transformation with the given matrix.

The matrix composition follows the equation AB = C, where A is the transformation matrix specified by Matrix3dgeoId, B is the transformation matrix defined by the parameter associations, and C is the resulting transformation matrix. The values of the resulting transformation matrix are written to the transformation matrix object specified by Matrix3dgeoId.

Note that transformation matrix B is applied before transformation matrix A. Therefore, transformation matrix C describes the transformation obtained by applying transformation matrix B followed by transformation matrix A.

(summarize)

The table below lists possible values for the TransformType, Param1, Param2, Param3, and Param4 parameters.

Set unused parameters to M_DEFAULT.

function map For specifying the transformation type
Click to summarizeTransformType Description
Param1
Param2
Param3
Param4
Click to summarize M_COMPOSE_TWO_MATRICES

Specifies the transformation resulting from the composition of two matrices.

The matrix composition follows the equation AB = C, where A is the transformation matrix specified by Param1, B is the transformation matrix specified by Param2, and C is the resulting transformation matrix.

Note that transformation matrix B is applied before transformation matrix A. Therefore, transformation matrix C describes the transformation obtained by applying transformation matrix B followed by transformation matrix A.

(summarize)
Click to summarize Param1

Specifies the first source matrix (that is, source matrix A).

(summarize)
Click to summarize M_IDENTITY_MATRIX

Specifies the identity matrix.

Click to summarize MIL transformation matrix object identifier

Specifies the identifier of a transformation matrix object.

Click to summarize Param2

Specifies the second source matrix (that is, source matrix B).

(summarize)
Click to summarize M_IDENTITY_MATRIX

Specifies the identity matrix.

Click to summarize MIL transformation matrix object identifier

Specifies the identifier of a transformation matrix object.

Click to summarize M_FIXTURE_TO_GEOMETRY

Specifies a transformation that can move the working coordinate system to a 3D geometry object.

(summarize)
Click to summarize Param1

Specifies a 3D geometry object.

(summarize)
Click to summarize MIL 3D box geometry object identifier

Specifies a 3D box geometry object identifier previously allocated using M3dgeoAlloc() with M_GEOMETRY and successfully defined as a box.

The result is the transformation that can move the working coordinate system such that its origin moves to the box's center, and the box's orientation is applied.

(summarize)
Click to summarize MIL 3D cylinder geometry object identifier

Specifies a 3D cylinder geometry object identifier previously allocated using M3dgeoAlloc() with M_GEOMETRY and successfully defined as a cylinder.

The result is the transformation that can move the working coordinate system such that its origin moves to the cylinder's start point, and the cylinder's central axis becomes the positive Z-axis. The rotation of the X- and Y-axis is determined by the minimal rotation that must be applied to align the positive Z-axis with the cylinder's central axis.

(summarize)
Click to summarize MIL 3D plane geometry object identifier

Specifies a 3D plane geometry object identifier previously allocated using M3dgeoAlloc() with M_GEOMETRY and successfully defined as a plane.

The result is the transformation that can move the working coordinate system such that its XY (Z=0) plane is moved to the specified plane, and the plane's normal becomes the positive Z-axis. The working coordinate system's origin is moved to the closest point on the plane (the projection).

(summarize)
Click to summarize MIL 3D sphere geometry object identifier

Specifies a 3D sphere geometry object identifier previously allocated using M3dgeoAlloc() with M_GEOMETRY and successfully defined as a sphere.

The result is the transformation that can move the working coordinate system such that its origin is moved to the sphere's center. No rotation is applied.

(summarize)
Click to summarize M_FIXTURE_TO_PLANE

Specifies a transformation that can move the XY (Z=0) plane of the working coordinate system to a plane specified by Param1. By default, the origin is moved using the same transformation. You can optionally specify a point on the plane where the origin should be moved, using Param2, Param3, and Param4. If the point is not on the plane, or if you set Param2, Param3, and Param4 to M_DEFAULT, the closest point on the plane (the projection) is chosen instead.

(summarize)
Click to summarize Param1

Specifies a 3D geometry plane.

(summarize)
Click to summarize M_XY_PLANE

Specifies the XY (Z=0) plane.

The result is the transformation that can move the origin of the working coordinate system to a point on its XY (Z=0) plane, specified by Param2, Param3, and Param4. If these parameters are set to M_DEFAULT, the result is the identity transformation.

(summarize)
Click to summarize MIL 3D geometry object identifier

Specifies a 3D plane geometry object identifier previously allocated using M3dgeoAlloc() with M_GEOMETRY and successfully defined as a plane.

Click to summarize Param2

Specifies the X-coordinate of a point on the plane where the origin will be moved.

Click to summarize Param3

Specifies the Y-coordinate of a point on the plane where the origin will be moved.

Click to summarize Param4

Specifies the Z-coordinate of a point on the plane where the origin will be moved.

Click to summarize M_IDENTITY

Specifies the identity transformation. This resets the matrix to the identity matrix, removing all transformations from the transformation matrix object, when ControlFlag is M_ASSIGN.

(summarize)
Click to summarize M_INVERSE

Specifies the inverse transformation.

(summarize)
Click to summarize Param1

Specifies the source matrix.

(summarize)
Click to summarize MIL transformation matrix object identifier

Specifies the identifier of a transformation matrix object previously allocated using M3dgeoAlloc() with M_TRANSFORMATION_MATRIX.

Click to summarize M_ROTATION_AXIS_ANGLE

Specifies a rotation described by an axis and angle of rotation. The axis of rotation is defined by a vector. The angle of rotation is measured in the counter-clockwise direction around the axis of rotation. INQ

(summarize)
Click to summarize Param1

Specifies the X-component of the vector that defines the axis of rotation.

Click to summarize Param2

Specifies the Y-component of the vector that defines the axis of rotation.

Click to summarize Param3

Specifies the Z-component of the vector that defines the axis of rotation.

Click to summarize Param4

Specifies the angle of the rotation, in degrees, around the axis of rotation.

(summarize)
Click to summarize M_ROTATION_AXIS_X

Specifies the minimal rotation that can align the working coordinate system's X-axis with the specified vector. INQ

(summarize)
Click to summarize Param1

Specifies the X-component of the vector.

Click to summarize Param2

Specifies the Y-component of the vector.

Click to summarize Param3

Specifies the Z-component of the vector.

Click to summarize M_ROTATION_AXIS_Y

Specifies the minimal rotation that can align the working coordinate system's Y-axis with the specified vector. INQ

(summarize)
Click to summarize Param1

Specifies the X-component of the vector.

Click to summarize Param2

Specifies the Y-component of the vector.

Click to summarize Param3

Specifies the Z-component of the vector.

Click to summarize M_ROTATION_AXIS_Z

Specifies the minimal rotation that can align the working coordinate system's Z-axis with the specified vector. INQ

(summarize)
Click to summarize Param1

Specifies the X-component of the vector.

Click to summarize Param2

Specifies the Y-component of the vector.

Click to summarize Param3

Specifies the Z-component of the vector.

Click to summarize M_ROTATION_QUATERNION

Specifies a rotation operation that is described by a rotation quaternion. INQ

(summarize)
Click to summarize Param1

Specifies the scalar component of the quaternion.

Click to summarize Param2

Specifies the X-component of the quaternion.

Click to summarize Param3

Specifies the Y-component of the quaternion.

Click to summarize Param4

Specifies the Z-component of the quaternion.

Click to summarize M_ROTATION_X

Specifies a rotation operation around the X-axis.

(summarize)
Click to summarize Param1

Specifies the X-axis rotation, in degrees.

(summarize)
Click to summarize M_ROTATION_XYZ

Specifies a rotation that is described by three distinct rotations about the axes of the working coordinate system in the following order: a rotation about the X-axis, a rotation about the Y-axis, and a rotation about the Z-axis rotation. INQ

(summarize)
Click to summarize Param1

Specifies the X-axis rotation, in degrees.

(summarize)
Click to summarize Param2

Specifies the Y-axis rotation, in degrees.

(summarize)
Click to summarize Param3

Specifies the Z-axis rotation, in degrees.

(summarize)
Click to summarize M_ROTATION_XZY

Specifies a rotation that is described by three distinct rotations about the axes of the working coordinate system in the following order: a rotation about the X-axis, a rotation about the Z-axis, and a rotation about the Y-axis rotation. INQ

(summarize)
Click to summarize Param1

Specifies the X-axis rotation, in degrees.

(summarize)
Click to summarize Param2

Specifies the Z-axis rotation, in degrees.

(summarize)
Click to summarize Param3

Specifies the Y-axis rotation, in degrees.

(summarize)
Click to summarize M_ROTATION_Y

Specifies a rotation operation around the Y-axis.

(summarize)
Click to summarize Param1

Specifies the Y-axis rotation, in degrees.

(summarize)
Click to summarize M_ROTATION_YXZ

Specifies a rotation that is described by three distinct rotations about the axes of the working coordinate system in the following order: a rotation about the Y-axis, a rotation about the X-axis, and a rotation about the Z-axis rotation. INQ

(summarize)
Click to summarize Param1

Specifies the Y-axis rotation, in degrees.

(summarize)
Click to summarize Param2

Specifies the X-axis rotation, in degrees.

(summarize)
Click to summarize Param3

Specifies the Z-axis rotation, in degrees.

(summarize)
Click to summarize M_ROTATION_YZX

Specifies a rotation that is described by three distinct rotations about the axes of the working coordinate system in the following order: a rotation about the Y-axis, a rotation about the Z-axis, and a rotation about the X-axis rotation. INQ

(summarize)
Click to summarize Param1

Specifies the Y-axis rotation, in degrees.

(summarize)
Click to summarize Param2

Specifies the Z-axis rotation, in degrees.

(summarize)
Click to summarize Param3

Specifies the X-axis rotation, in degrees.

(summarize)
Click to summarize M_ROTATION_Z

Specifies a rotation operation around the Z-axis.

(summarize)
Click to summarize Param1

Specifies the Z-axis rotation, in degrees.

(summarize)
Click to summarize M_ROTATION_ZXY

Specifies a rotation that is described by three distinct rotations about the axes of the working coordinate system in the following order: a rotation about the Z-axis, a rotation about the X-axis, and a rotation about the Y-axis rotation. INQ

(summarize)
Click to summarize Param1

Specifies the Z-axis rotation, in degrees.

(summarize)
Click to summarize Param2

Specifies the X-axis rotation, in degrees.

(summarize)
Click to summarize Param3

Specifies the Y-axis rotation, in degrees.

(summarize)
Click to summarize M_ROTATION_ZYX

Specifies a rotation that is described by three distinct rotations about the axes of the working coordinate system in the following order: a rotation about the Z-axis, a rotation about the Y-axis, and a rotation about the X-axis rotation. INQ

(summarize)
Click to summarize Param1

Specifies the Z-axis rotation, in degrees.

(summarize)
Click to summarize Param2

Specifies the Y-axis rotation, in degrees.

(summarize)
Click to summarize Param3

Specifies the X-axis rotation, in degrees.

(summarize)
Click to summarize M_SCALE

Specifies a scaling operation. INQ

(summarize)
Click to summarize Param1

Specifies the scaling factor in X.

Click to summarize Param2

Specifies the scaling factor in Y.

Click to summarize Param3

Specifies the scaling factor in Z.

Click to summarize M_TRANSLATION

Specifies a translation along each of the axes of the working coordinate system. INQ

(summarize)
Click to summarize Param1

Specifies the displacement along the X-axis.

Click to summarize Param2

Specifies the displacement along the Y-axis.

Click to summarize Param3

Specifies the displacement along the Z-axis.

Compilation information
Header Include mil.h.
Library Use mil.lib; mil3d.lib.
DLL Requires mil.dll; mil3d.dll.
DEFAULT ASSIGN COMPOSE WITH CURRENT COMPOSE TWO MATRICES IDENTITY MATRIX IDENTITY MATRIX FIXTURE TO GEOMETRY BOX CYLINDER PLANE SPHERE FIXTURE TO PLANE XY PLANE PLANE IDENTITY INVERSE ROTATION AXIS ANGLE ROTATION AXIS X ROTATION AXIS Y ROTATION AXIS Z ROTATION QUATERNION ROTATION X ROTATION XYZ ROTATION XZY ROTATION Y ROTATION YXZ ROTATION YZX ROTATION Z ROTATION ZXY ROTATION ZYX SCALE TRANSLATION