Traslate and Rotate a point cloud
조회 수: 17(최근 30일)
표시 이전 댓글
Alberto Acri 2022년 11월 28일
Hi! I have a point cloud (.txt file with R rows and 3 columns).
I want to translate the point cloud from the center of gravity G = [100, 100, 100] to a point A = [0,0,0].
And possibly also rotate it by a certain angle.
댓글 수: 0
Jonas 2022년 11월 28일
if you have a matrix nx3, with each row being one set of point corrdinates you can translate first and rotate afterwards using subtraction
points=[1 0 0; 2 0 0; 3 0 0; 4 0 0]+[100 80 50]; % one point per row
translateBy=[100 50 30]; % row vector
% in degree
% first matrix flip because rotation matrix want one ppoint per column
% second matrix flip
댓글 수: 2
Jonas 2022년 11월 29일
if you have apoint cloud with center of gravity [100, 140, 50] and you want to move the center of gravity to [0,0,0], then just subtract the given coordinates before rotation.
-> set translateBy to [100, 140, 50]
of course your center of gravity moves with the points, so G would equal A afterwards
Find more on Point Cloud Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!