# Point cloud 3D Rotation around arbitrary axis Classic List Threaded 6 messages Open this post in threaded view
|

## Point cloud 3D Rotation around arbitrary axis

 Hi How could I compute transformation matrix around arbitrary axis for a point cloud?There is many useful resources like below but I could not realize them.https://sites.google.com/site/glennmurray/Home/rotation-matrices-and-formulas/rotation-about-an-arbitrary-axis-in-3-dimensions"(1) Translate space so that the rotation axis passes through the origin. (2) Rotate space about the z axis so that the rotation axis lies in the xz plane. (3) Rotate space about the y axis so that the rotation axis lies along the z axis. (4) Perform the desired rotation by θ about the z axis. (5) Apply the inverse of step (3). (6) Apply the inverse of step (2). (7) Apply the inverse of step (1)."I have point cloud generated by a custom made scanner. I am rotating the object around 2 axis (ZX) but of course rotation axises are not aligned to center of the sensor. I could not apply steps 2 and 3. Lets say sensor coords are (xs, ys, zs) = [0 ,0, 0}I have point coordinates (xi, yi, zi) and the rotation axis center (xr, yr, zr).After translate point coordinates to (xr,yr,zr) how will I apply rotation around (zr)?Is there any module or Eigen method?-- Mehmet Akif Ceylan05375918497 _______________________________________________ [hidden email] / http://pointclouds.orghttp://pointclouds.org/mailman/listinfo/pcl-users
Open this post in threaded view
|

## Re: Point cloud 3D Rotation around arbitrary axis

Open this post in threaded view
|

## Re: Point cloud 3D Rotation around arbitrary axis

 Thank you very much DevSH I will work on quaternions. For Euler solution... I should calculate a vector from every point to rotation center and compute a new transformation matrix or at least rotation matrix according to given solution I think, right? Or finding a centroid for the cloud and calculating one transformation matrix to apply all the points in it will work? -- Sent from: http://www.pcl-users.org/_______________________________________________ [hidden email] / http://pointclouds.orghttp://pointclouds.org/mailman/listinfo/pcl-users
Open this post in threaded view
|

## Re: Point cloud 3D Rotation around arbitrary axis

 Essentially all rotation is mathematically defined to take place around the origin (0,0,0) So you need to shift all the points by the difference between the center of rotation and the origin. Then perform the rotation, and shift back by the same amount. On 03/05/18 00:28, meakcey wrote: > Thank you very much DevSH > > I will work on quaternions. > > For Euler solution... > I should calculate a vector from every point to rotation center and compute > a new transformation matrix or at least rotation matrix according to given > solution I think, right? > Or finding a centroid for the cloud and calculating one transformation > matrix to apply all the points in it will work? > > > > -- > Sent from: http://www.pcl-users.org/> _______________________________________________ > [hidden email] / http://pointclouds.org> http://pointclouds.org/mailman/listinfo/pcl-users> _______________________________________________ [hidden email] / http://pointclouds.orghttp://pointclouds.org/mailman/listinfo/pcl-users