MIL_ID CalibratedMilObjectId,  //in 
MIL_INT64 TargetCoordinateSystem,  //in 
MIL_INT64 ReferenceCoordinateSystem,  //in 
MIL_INT64 TransformType,  //in 
MIL_ID ArrayBufOrMatrix3dgeoId,  //in 
MIL_DOUBLE Param1,  //in 
MIL_DOUBLE Param2,  //in 
MIL_DOUBLE Param3,  //in 
MIL_DOUBLE Param4  //in 
This function moves a specified (target) coordinate system in relation to a specified (reference) coordinate system. For example, you can move the relative coordinate system by (0, 6, 0) in the absolute coordinate system. This will displace the origin of the relative coordinate system by 6 units along the Yaxis of the absolute coordinate system. You can call this function to move the relative coordinate system of a camera calibration context, calibrated image, or 3D reconstruction result buffer of type M_POINT_CLOUD_RESULT. Note that to return the position and orientation of one coordinate system as a transformation of another coordinate system, you can use McalGetCoordinateSystem().
If you are moving the relative coordinate system of an image that has been corrected, the XYplane of the relative coordinate system should not be moved in the Zdirection and should not be rotated around its X or Yaxis. In other words, the relative coordinate system of a corrected image can only be translated along its X or Yaxis or rotated around its Zaxis. Moving the relative coordinate system of an image is useful for analyzing an object using a temporary local coordinate system. You can also use McalFixture() to move the relative coordinate system with respect to a result. If you move the relative coordinate system, results returned in world units from other modules are returned with respect to the relative coordinate system's new position, and settings which accept input in world units will accept that input with respect to the relative coordinate system's new position.
If you transform the camera or tool coordinate system, MIL assumes that the camera has been moved in your camera setup, so it adjusts the camera calibration mapping between the absolute coordinate system and the pixel coordinate system.
You can also use this function to transform the relative coordinate system of a 3D reconstruction result buffer of type M_POINT_CLOUD_RESULT, which M3dmapGetResult() uses to express world coordinates. To transform the relative coordinate system of a result buffer, TargetCoordinateSystem must be set to M_RELATIVE_COORDINATE_SYSTEM and ReferenceCoordinateSystem must be set to M_RELATIVE_COORDINATE_SYSTEM or M_ABSOLUTE_COORDINATE_SYSTEM.
Note that all angles should be given in degrees. However, unlike most other MIL functions (including McalRelativeOrigin()), angles are interpreted using the righthand 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 Zaxis corresponds to a rotation that turns the positive Xaxis toward the positive Yaxis.
You can specify whether the transformation of the target coordinate system is applied from the current position (M_COMPOSE_WITH_CURRENT) of the target coordinate system or from the origin of the reference coordinate system (M_ASSIGN).
Note that you cannot move the pixel coordinate system nor the absolute coordinate system.
If you adjust the coordinate system of a calibrated image associated with an M_VECTOR_AND_RASTER ROI, the raster information will be discarded, causing the ROI to become an M_VECTOR ROI. See MbufSetRegion() for more information.
Specifies the identifier of a camera calibration context, 3D reconstruction result buffer of type M_POINT_CLOUD_RESULT, or a calibrated image.
Specifies the coordinate system on which to apply the transformation. This parameter can be set to one of the following.
If CalibratedMilObjectId is set to a 3D reconstruction result buffer (must be of type M_POINT_CLOUD_RESULT) or a calibrated image, TargetCoordinateSystem must be set to M_RELATIVE_COORDINATE_SYSTEM.
For specifying the target coordinate
system


Value  Description  
M_CAMERA_COORDINATE_SYSTEM 
Specifies to apply the transformation to the camera coordinate system. 

M_RELATIVE_COORDINATE_SYSTEM 
Specifies to apply the transformation to the relative coordinate system. 

M_ROBOT_BASE_COORDINATE_SYSTEM 
Specifies to apply the transformation to the robotbase coordinate system. 

M_TOOL_COORDINATE_SYSTEM 
Specifies to apply the transformation to the tool coordinate system. 
Specifies the reference coordinate system. The reference coordinate system must be defined before calling this function. This parameter can be set to one of the following values.
If your CalibratedMilObjectId is a 3D reconstruction result buffer (must be of type M_POINT_CLOUD_RESULT), ReferenceCoordinateSystem must be set to M_RELATIVE_COORDINATE_SYSTEM or M_ABSOLUTE_COORDINATE_SYSTEM.
For specifying the reference coordinate
system


Value  Description  
M_DEFAULT 
Same as M_ABSOLUTE_COORDINATE_SYSTEM. 

M_ABSOLUTE_COORDINATE_SYSTEM 
Specifies to use the absolute coordinate system as a reference coordinate system for the transformation. 

M_CAMERA_COORDINATE_SYSTEM 
Specifies to use the camera coordinate system as a reference coordinate system for the transformation. 

M_RELATIVE_COORDINATE_SYSTEM 
Specifies to use the relative coordinate system as a reference coordinate system for the transformation. 

M_ROBOT_BASE_COORDINATE_SYSTEM 
Specifies to use the robot base coordinate system as a reference coordinate system for the transformation. 

M_TOOL_COORDINATE_SYSTEM 
Specifies to use the tool coordinate system as a reference coordinate system for the transformation. 
Specifies the type of transformation to apply to the target coordinate system.
See the Parameter associations section for possible values that can be specified.
Specifies the identifier of a MIL array buffer that contains the transformation matrix to use, or specifies the identifier of a transformation matrix object. The expected transformation matrix is dependent on the type of transformation selected.
The MIL array buffer must be a 32bit floatingpoint buffer, allocated using MbufAlloc2d() with M_ARRAY. The required buffer size is dependent on the type of transformation selected.
The transformation matrix object must have been previously allocated using M3dgeoAlloc() with M_TRANSFORMATION_MATRIX.
If using a transformation matrix, it must represent a rotation and/or translation, nothing else (for example, it cannot represent a scale); otherwise, an error is reported.
Set this parameter to M_NULL if not used.
See the Parameter associations section for possible values that can be specified.
Specifies an attribute of the transformation. Its definition is dependent on the type of transformation selected.
Set this parameter to M_DEFAULT if not used.
See the Parameter associations section for possible values that can be specified.
Specifies an attribute of the transformation. Its definition is dependent on the type of transformation selected.
Set this parameter to M_DEFAULT if not used.
See the Parameter associations section for possible values that can be specified.
Specifies an attribute of the transformation. Its definition is dependent on the type of transformation selected.
Set this parameter to M_DEFAULT if not used.
See the Parameter associations section for possible values that can be specified.
Specifies an attribute of the transformation. Its definition is dependent on the type of transformation selected.
Set this parameter to M_DEFAULT if not used.
See the Parameter associations section for possible values that can be specified.
The table below lists possible values for the TransformType, ArrayBufOrMatrix3dgeoId, Param1, Param2, Param3, and Param4 parameters.
Note that if Param1, Param2, Param3, or Param4 are not required by the transformation, they should be set to M_DEFAULT.
For specifying the transformation type


TransformType  Description  
ArrayBufOrMatrix3dgeoId  
Param1  
Param2  
Param3  
Param4  
M_HOMOGENEOUS_MATRIX + 
Specifies to apply a translation, a rotation, or both to the target coordinate system. 

ArrayBufOrMatrix3dgeoId 
Specifies the identifier of the MIL array buffer or the transformation matrix object containing the matrix representation of the rotation. 

M_IDENTITY + 
Specifies to apply the identity transformation to the target coordinate system. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

M_ROTATION_AXIS_ANGLE + 
Specifies to apply a rotation operation described by an axis and angle of rotation. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the Xcomponent of the vector that defines the axis of rotation. 

Param2 
Specifies the Ycomponent of the vector that defines the axis of rotation. 

Param3 
Specifies the Zcomponent of the vector that defines the axis of rotation. 

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

M_ROTATION_AXIS_X + 
Specifies to apply a rotation operation on the target coordinate system which corresponds to the rotation that aligns the Xaxis of the reference coordinate system with the specified vector. 

Param1 
Specifies the Xcomponent of the vector. 

Param2 
Specifies the Ycomponent of the vector. 

Param3 
Specifies the Zcomponent of the vector. 

M_ROTATION_AXIS_Y + 
Specifies to apply a rotation operation on the target coordinate system which corresponds to the rotation that aligns the Yaxis of the reference coordinate system with the specified vector. 

Param1 
Specifies the Xcomponent of the vector. 

Param2 
Specifies the Ycomponent of the vector. 

Param3 
Specifies the Zcomponent of the vector. 

M_ROTATION_AXIS_Z + 
Specifies to apply a rotation operation on the target coordinate system which corresponds to the rotation that aligns the Zaxis of the reference coordinate system with the specified vector. 

Param1 
Specifies the Xcomponent of the vector. 

Param2 
Specifies the Ycomponent of the vector. 

Param3 
Specifies the Zcomponent of the vector. 

M_ROTATION_MATRIX + 
Specifies to apply a rotation operation that is described by a 3x3 rotation matrix. 

ArrayBufOrMatrix3dgeoId 
Specifies the identifier of the MIL array buffer or the transformation matrix object containing the matrix representation of the rotation. 

M_ROTATION_QUATERNION + 
Specifies to apply a rotation operation that is described by a rotation quaternion. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the scalar component of the quaternion. 

Param2 
Specifies the Xcomponent of the quaternion. 

Param3 
Specifies the Ycomponent of the quaternion. 

Param4 
Specifies the Zcomponent of the quaternion. 

M_ROTATION_X + 
Specifies to apply a rotation operation that is described by a rotation around the Xaxis. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the Xaxis rotation, in degrees. 

M_ROTATION_XYZ + 
Specifies to apply a rotation operation that is described by three distinct rotations about the axes of the reference coordinate system in the following order: a rotation about the Xaxis, a rotation about the Yaxis, and a rotation about Zaxis rotation. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the Xaxis rotation, in degrees. 

Param2 
Specifies the Yaxis rotation, in degrees. 

Param3 
Specifies the Zaxis rotation, in degrees. 

M_ROTATION_XZY + 
Specifies to apply a rotation operation that is described by three distinct rotations about the axes of the reference coordinate system in the following order: a rotation about the Xaxis, a rotation about the Zaxis, and a rotation about the Yaxis rotation. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the Xaxis rotation, in degrees. 

Param2 
Specifies the Zaxis rotation, in degrees. 

Param3 
Specifies the Yaxis rotation, in degrees. 

M_ROTATION_Y + 
Specifies to apply a rotation operation that is described by a rotation about the Yaxis. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the Yaxis rotation, in degrees. 

M_ROTATION_YXZ + 
Specifies to apply a rotation operation that is described by three distinct rotations about the axes of the reference coordinate system in the following order: a rotation about the Yaxis, a rotation about the Xaxis, and a rotation about Zaxis rotation. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the Yaxis rotation, in degrees. 

Param2 
Specifies the Xaxis rotation, in degrees. 

Param3 
Specifies the Zaxis rotation, in degrees. 

M_ROTATION_YZX + 
Specifies to apply a rotation operation that is described by three distinct rotations about the axes of the reference coordinate system in the following order: a rotation about the Yaxis, a rotation about the Zaxis, and a rotation about the Xaxis rotation. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the Yaxis rotation, in degrees. 

Param2 
Specifies the Zaxis rotation, in degrees. 

Param3 
Specifies the Xaxis rotation, in degrees. 

M_ROTATION_Z + 
Specifies to apply a rotation operation that is described by a rotation about the Zaxis. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the Zaxis rotation, in degrees. 

M_ROTATION_ZXY + 
Specifies to apply a rotation operation that is described by three distinct rotations about the axes of the reference coordinate system in the following order: a rotation about the Zaxis, a rotation about the Xaxis, and a rotation about the Yaxis rotation. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the Zaxis rotation, in degrees. 

Param2 
Specifies the Xaxis rotation, in degrees. 

Param3 
Specifies the Yaxis rotation, in degrees. 

M_ROTATION_ZYX + 
Specifies to apply a rotation operation that is described by three distinct rotations about the axes of the reference coordinate system in the following order: a rotation about the Zaxis, a rotation about the Yaxis, and a rotation about the Xaxis rotation. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the Zaxis rotation, in degrees. 

Param2 
Specifies the Yaxis rotation, in degrees. 

Param3 
Specifies the Xaxis rotation, in degrees. 

M_TRANSLATION + 
Specifies to apply a translation operation along each of the reference coordinate system's axes. 

ArrayBufOrMatrix3dgeoId 
This parameter must be set to M_NULL. 

Param1 
Specifies the displacement along the Xaxis of the reference coordinate system. 

Param2 
Specifies the displacement along the Yaxis of the reference coordinate system. 

Param3 
Specifies the displacement along the Zaxis of the reference coordinate system. 
You must add one of the following values to the abovementioned values to specify how to apply the transformation.
For specifying how to apply the
transformation


Combination value  Description  
M_ASSIGN 
Specifies to assign the specified transformation to the target coordinate system from the origin and orientation of the reference coordinate system. 

M_COMPOSE_WITH_CURRENT 
Specifies to compose the specified transformation with the current position and orientation in the reference coordinate system. 
Header  Include mil.h. 
Library  Use mil.lib; milcal.lib. 
DLL  Requires mil.dll; milcal.dll. 