Rotating a point cloud fails

2 ビュー (過去 30 日間)
Pseudoscientist
Pseudoscientist 2022 年 9 月 2 日
コメント済み: Pseudoscientist 2022 年 9 月 2 日
Hello,
I'm attempting a rotate a point cloud that is defined in the attachment 'point_cloud.mat'. The points are 32 points equidistant on the surface of a unit sphere.
load('point_cloud.mat')
scatter3(V1(:,1),V1(:,2),V1(:,3))
% I'm attemping to rotate the point cloud around the three elementary rotation axes simultaneously:
for x=1:360
Rx = [1 0 0; 0 cosd(x) -sind(x); 0 sind(x) cosd(x)];
Ry = [cosd(x) 0 sind(x); 0 1 0; -sind(x) 0 cosd(x)];
Rz = [cosd(x) -sind(x) 0; sind(x) cosd(x) 0; 0 0 1];
rotation_mat = Rx*Ry*Rz;
V = rotation_mat*[V1(:,1) V1(:,2) V1(:,2)]'; % rotate data
h = scatter3(V(1,:)',V(2,:)',V(3,:)','g');
pause(0.05)
hold on
delete(h)
end
However, it looks the projection of the 3d point cloud on a 2d surface is being rotated not the point cloud.. ANy ideas?

採用された回答

Bruno Luong
Bruno Luong 2022 年 9 月 2 日
The last index of this line should be 3
V = rotation_mat*[V1(:,1) V1(:,2) V1(:,2)]'
  1 件のコメント
Pseudoscientist
Pseudoscientist 2022 年 9 月 2 日
i must be blind...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by