Herror ::hom_mat3d_translate (
    const HTuple &HomMat3D,
    const HTuple &Tx,
    const HTuple &Ty,
    const HTuple &Tz,
    HTuple *HomMat3DTranslate
)

Add a translation to a homogeneous 3D transformation matrix.

::hom_mat3d_translate adds a translation by the vector (Tx,Ty,Tz) to a homogeneous 3D transformation matrix HomMat3D. The resulting matrix is returned in HomMat3DTranslate.

The homogeneous 4x3 transformation matrix HomMat3D describes the transformation of a 3D point from the source coordinate system into the destination coordinate system. In this sight ::hom_mat3d_translate is used to generate a new 4x3 transformation matrix HomMat3DTranslate by translating the origin of HomMat3D along the negative Axis by the amount (in meter) of the according to the vector (Tx,Ty,Tz).

If you want to translate the source coordinate system, you have to invert the transformation matrix using ::hom_mat3d_invert, translate it using ::hom_mat3d_translate, and invert it back again.

The transformation of a 3D point (given in the source coordinate system) into a destination coordinate system ist given by a rotation R and a translation T (see ::affine_trans_point_3d). Thus, the following holds:

/ x2 \           / x1 \
| y2 | = R_trans | y1 | + T_trans
\ z2 /           \ z1 /

               / x2 \   
       = R_org | y2 | + ( T_org + T_delta)
               \ z2 /
with
          / tx \
T_delta = | ty |  Translation
          \ tz /


Parameters

HomMat3D (input_control)
affine3d-array -> HTuple.double
Input transformation matrix.
Number of elements: 12

Tx (input_control)
point3d.x -> HTuple.double / long
Translation along the x-axis.
Default value: 64
Suggested values: 0, 16, 32, 64, 128, 256, 512, 1024
Typical range of values: 0 <= Tx <= 1024
Minimum increment: 1
Recommended increment: 10

Ty (input_control)
point3d.y -> HTuple.double / long
Translation along the y-axis.
Default value: 64
Suggested values: 0, 16, 32, 64, 128, 256, 512, 1024
Typical range of values: 0 <= Ty <= 1024
Minimum increment: 1
Recommended increment: 10

Tz (input_control)
point3d.z -> HTuple.double / long
Translation along the z-axis.
Default value: 64
Suggested values: 0, 16, 32, 64, 128, 256, 512, 1024
Typical range of values: 0 <= Tz <= 1024
Minimum increment: 1
Recommended increment: 10

HomMat3DTranslate (output_control)
affine3d-array -> HTuple.double *
Output transformation matrix.
Number of elements: 12


Example
Tuple CamPose, HomTransMat, HomTransMatTransl, HomTransMatInv;
Tuple HomTransMatTransl2, HomTransMat2;
// read camera pose
::read_pose("campose.dat",&CamPose);
// transform pose to transformation matrix
::pose_to_hom_mat3d(CamPose,&HomTransMat);
// translate destination coordinate along x-axis by 0.4 m
::hom_mat3d_translate(HomTransMat,-0.4,0,0,"x",&HomTransMatTransl);
// translate source coordinate along y-axis by -0.03 m
::hom_mat3d_invert(HomTransMat, &HomTransMatInv);
::hom_mat3d_translate(HomTransMatInv,0,0.03,0,&HomTransMatTransl2);
::hom_mat3d_invert(HomTransMatTransl2,&HomTransMat2);

Result

::hom_mat3d_identity always returns H_MSG_TRUE.


Possible Predecessors

::hom_mat3d_identity, ::hom_mat3d_translate, ::hom_mat3d_scale, ::hom_mat3d_rotate


Possible Successors

::hom_mat3d_translate, ::hom_mat3d_scale, ::hom_mat3d_rotate


See also

::hom_mat3d_invert, ::hom_mat3d_identity, ::hom_mat3d_rotate, ::hom_mat3d_translate, ::pose_to_hom_mat3d, ::hom_mat3d_to_pose, ::hom_mat3d_compose


Module

Basic operators



Copyright © 1996-2002 MVTec Software GmbH