Change from one cartesian 3D co-ordinate system to another by translation and rotation

10,896

Solution 1

Given this information, how can I calculate the value of Wx, Wy and Wx. How can I calculate the 3rd row of rotation matrix R?

Since you already have U and V, the two basis vectors of the orthonormal UVW system, the W basis vector would be the cross product of U and V. The cross product gives out the vector that is perpendicular to its operands; hence W = U × V. The components of W would fill in the third row of the rotation matrix.

Is my approach correct?

The order of the transforms matter; changing the order would lead to different results. When doing transformations of systems, usually scaling and rotation are tackled first and translation is dealt with lastly. The reason for this is that rotation would always be with respect to the origin. If the new system isn't on the old one's origin then applying rotation would rotate the new system not around its own origin but around the old system's origin. See the rightside case of figure 3-4 on this page to understand the difference what would happen if it's not on the origin; imagine the pot as the UVW coordinate system.

Think of both the coordinate systems being super-imposed (laid one atop the other). Now when you rotate UVW system with respect to the origin of XYZ, you will end up with the effect of rotating UVW w.r.t its own origin. Once rightly oriented, you can apply translation to it. However, if you'd already translated, then rotating would lead to translated rotation.

If you're using column-vector convention then TR would be the order i.e. rotation followed by translation. If you're using the row-vector convention then RT would be the order, again the order is rotation followed by translation.

Solution 2

You can apply the cross product of the Vectors OU and OV.

Share:
10,896
Saania
Author by

Saania

Studying Computer Vision

Updated on June 04, 2022

Comments

  • Saania
    Saania almost 2 years

    There are two reasons for me to ask this question:

    1. I want to know if my understanding on this issue is correct.
    2. To clarify a doubt I have.

    I want to change the co-ordinate system of a set of points (Old cartesian coordinates system to New cartesian co-ordinate system). This transformation will involve Translation as well as Rotation. This is what I plan to do:

    enter image description here

    With respect to this image I have a set of points which are in the XYZ coordinate system (Red). I want to change it with respect to the axes UVW (Purple). In order to do so, I have understood that there are two steps involved: Translation and Rotation.

    When I translate, I only change the origin. (say, I want the UVW origin at (5,6,7). Then, for all points in my data, the x co-ordinates will be subtracted by 5, y by 6 and z by 7. By doing so. I get a set of Translated data.)

    Now I have to apply a rotation transform (on the Translated data). The Rotation matrix is shown in the image. The values Ux, Uy and Uz are the co-ordinates of a point on the U axis which has unit distance from origin. Similarly, the values Vx, Vy and Vz are the coordinates of a point on the V axis which has a unit distance from origin. (I want to know if I am right here.) Wx, Wy, Wz is calculated as ((normalized u) X (normalised v))

    (Also, if it serves any purpose, I would like to let you know that I am using MATLAB.)

    edit:

    I have a set of 42 points in 3D (42 X 3 matrix A) I want the first point to be considered as origin of UVW plane. So the values of the first point will be my translation vector. Correct?

    Next, to calculate the Rotation vector: According to my requirement, the 6th row of matrix A has to be the U axis while 37th row has to be V axis. Consequently, vector u will be (1st row minus 6th row) of matrix A. While vector v will be (1st row minus 37th row) of matrix A.

    The first row of Rotation Matrix will be vector u/|u| (normalized). Second row will be vector v/|v| (v normalized). The third row will be (u X v) . Am I right here?

  • Saania
    Saania almost 9 years
    The cross product of the vectors OU and OV will give me an equaltion of normal to the plane. Correct? I want an equation of a point lying on the new W axis (for my third row of Rotation Matrix). How can I do this?
  • Saania
    Saania almost 9 years
    Well, I do not really know the values by which I want to rotate. I do not have that information. I only know the points lying on the UV plane.
  • Ander Biguri
    Ander Biguri almost 9 years
    @Meghana OUxOV will give you a vector in the direction W. If you know a point on the UV plane where you want that vector, then you can get W. You know a point. O.
  • Saania
    Saania almost 9 years
    Thanks @AnderBiguri . I got that now. I have edited my question. Please see it.