How to rotate a 3D cylinder to a straight up position

2 ビュー (過去 30 日間)
khcy82dyc
khcy82dyc 2017 年 4 月 18 日
編集済み: khcy82dyc 2017 年 4 月 18 日
I have few tall cylinder-like 3D objects (in different files) pointing to different directions and I'd like to 'straight them up'. Is there a quick solution to do this?
  2 件のコメント
Jan
Jan 2017 年 4 月 18 日
編集済み: Jan 2017 年 4 月 18 日
It depends on how the coordinates are store in the files and what "straighten up" exactly means. What exactly is "quick"? Programming time or run time?
khcy82dyc
khcy82dyc 2017 年 4 月 18 日
編集済み: khcy82dyc 2017 年 4 月 18 日
thanks for the reply! I'm hoping to rotate the objects so they look like all stand up straight.
I'm using the following functions to get the unit vector and rotate it in the opposite direction but the results come out a bit wrong:
stat = regionprops3(original3D,'MajorAxis');
rotated3D= rotImg3(double(original3D), 1*pi/2, 0-stat.MajorAxis);
from
https://uk.mathworks.com/matlabcentral/fileexchange/47578-regionprops3 https://uk.mathworks.com/matlabcentral/fileexchange/44990-3d-rotation-of-3d-image

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

回答 (0 件)

カテゴリ

Help Center および File Exchange3-D Scene Control についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by