Rotate the destination coordinate system.
The homogeneous 4x3 transformation matrix HomTransMatOrg describes the transformation of a 3D point from the source coordinate system into the destination coordinate system. hom_mat_rot is used to generate a new 4x3 transformation matrix HomTransMatRot by rotating the Axis-axis of HomTransMatOrg by the angle Phi (in mathematical positive direction).
If you want to rotate the source coordinate system, you have to invert the transformation matrix using hom_mat_invert, rotate it using hom_mat_rot, 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 hom_3d_trans). Thus, the following holds:
/ x2 \ / x1 \
| y2 | = R_rot | y1 | + T_rot
\ z2 / \ z1 /
/ x2 \
= ( R_phi R_org ) | y2 | + T_org
\ z2 /
with
/ 1 0 0 \
R_phi = | 0 cos(phi) -sin(phi) | Rotation around x-axis
\ 0 sin(phi) cos(phi) /
/ cos(phi) 0 sin(phi) \
R_phi = | 0 1 0 | Rotation around y-axis
\ -sin(phi) 0 cos(phi) /
/ cos(phi) -sin(phi) 0 \
R_phi = | sin(phi) cos(phi) 0 | Rotation around z-axis
\ 0 0 1 /
|
HomTransMatOrg (input_control) |
affin3d-array -> real |
| Original transformation matrix. | |
| Number of elements: 12 | |
|
Phi (input_control) |
real -> real |
| Rotation angle in degree. | |
| Default value: 90 | |
| Suggested values: 90, 180, 270 | |
| Range of values: 0 <= Phi <= 360 | |
| Minimum increment: 0.001 | |
|
Recommended increment: 0.2 | |
|
Axis (input_control) |
string -> string |
| Axis, to be rotated around. | |
| Default value: ''x'' | |
| Suggested values: ''x'', ''y'', ''z'' | |
|
HomTransMatRot (output_control) |
affin3d-array -> real |
| New transformation matrix. | |
| Number of elements: 12 | |
/* read camera pose */ read_cam_pose(::'campose.dat':CamPose) > /* transform pose to transformation matrix */ pose_to_hom_mat(::CamPose:HomTransMat) > /* rotate destination coordinate system around x-axis by 10 degree */ hom_mat_rot(::HomTransMat,10,'x':HomTransMatRot) > /* rotate source coordinate system around y-axis by 270 degree */ hom_mat_invert(::HomTransMat:HomTransMatInv) > hom_mat_rot(::HomTransMatInv,270,'y':HomTransMatRot2) > hom_mat_invert(::HomTransMatRot2:HomTransMat2).
hom_mat_rot returns TRUE if all parameter values are correct.
hom_mat_invert, hom_mat_ident, hom_mat_rot, hom_mat_translate, pose_to_hom_mat, hom_mat_to_pose, hom_mat_mult, hom_mat_values