1

I'm currently implementing an algorithm for 3D pointcloud filtering following a scientific paper.

I run in some problems when computing the rotation matrix for specific values. The goal is to rotate points into the coordinatesystem which is defined by the direction of the normal vector ( Z Axis). Since the following query is rotationally symmetric in X,Y axis, the orientation of these axis does not matter. R is defined as follows: Rotationmatrix

    [1      1  -(nx+ny)/nz]
R = [  (row1 x row3)'     ]
    [nx      ny      nz   ]

n is normalized. The problem occures when n_z becomes really small or zero. Therefore i considered to normalize row 1 before computing the crossproduct for row 2.

Nevertheless the determinant becomes -1. Will the rotationmatrix sill lead to correct results? R is orthogonal but det|R| not +1

thanks for any suggestions

andysfd
  • 13
  • 3

2 Answers2

1

You always get that

det(a, a×b, b) = - det( a, b, a×b) 
= - dot(a×b, a×b) 

is always negative. Thus you need to change the second row by negating it or by re-arranging the overall order of the rows.

Lutz Lehmann
  • 25,219
  • 2
  • 22
  • 51
  • thx, found out that, following the paper i get a reflection matrix. since the orientation in z axis doesn't matter it has no affect on the results. – andysfd Aug 03 '16 at 10:42
  • For others' benefit, it is problematic in many cases to use a transformation that contains a reflection when this is not *intentional*. Unless intentional, I second negating one of the vectors to preserve right-handed coordinates. – sage Oct 19 '16 at 20:50
-1

Are you interested in rotating points around arbitrary axis? If yes, maybe quaternions is good solution. You can check this if you want to transform a quaternion to matrix before you actually use it.