0
votes

I have rotation matrices, translation vector and a set of 3D categorized points (category depends on the z-coordinates). One 2x2 rotation matrix M and one 2x1 translation vector T are related to one category.

How can I apply my rotation and translation matrix on each point with coordinate (x, y, z) ? Is it simply that or I misunderstand the principle of rotation matrix?

add to M a column and a line of 0 
add to T a 0 for the z-transformation
then : (x, y, z) = M * (xp, yp, zp) + T
1

1 Answers

0
votes

If I understand you correctly you have an affine transformation on R^2 and you want to lift it to an affine transformation on R^3 in such a way that the effect when you apply it to (x,y,z) is to apply the original transformation to (x,y) and leave z unchanged.

If so -- you have to modify your matrix more carefully.

If your original matrix is

M =  [a  b]
     [c  d]

Then your new matrix should be

M' = [a  b  0]
     [c  d  0]
     [0  0  1]

Note the 1 in the lower right corner -- it is the missing ingredient in the approach that you described. Note that added row and column are the third row and column of the 3x3 identity matrix, which makes sense since you want the result to act like the identity matrix on z. It is easy to work out that

[a  b  0]   [x]    [ax+by]
[c  d  0]   [y]  = [cx+dy]
[0  0  1]   [z]    [  z  ]

Which is what I think you want. (I don't think Stack Overflow has any mark-up for matrices, but my notation should be clear enough)

You are handling T correctly (adding a zero z-component).