Lock axis for Rotate3D

7 ビュー (過去 30 日間)
Julius Schroers
Julius Schroers 2021 年 10 月 30 日
コメント済み: Julius Schroers 2021 年 11 月 2 日
Hey,
Is it possible to lock specific axes for rotate3D?
This would be very helpful as I want to rotate my plots around the z axis only.

採用された回答

Alamanda Ponappa Poovaya
Alamanda Ponappa Poovaya 2021 年 11 月 2 日
It is not possible to lock specific axis for rotate3D. However there is a workaround using the rotate function, using which you can fix the axis. Refer to the code snippet below as an example.
Rotate is not interactive, however by using the for loop as seen below, you can visualize rotation around any axis
% Sample plot
s = surf(peaks(20));
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')
% along z axis
direction = [0 0 1];
%rotate by 25 degrees
for i = 1:0.1:25
pause(0.2)
rotate(s,direction,i)
end
Documentation:
  1 件のコメント
Julius Schroers
Julius Schroers 2021 年 11 月 2 日
Thanks alot!
Got multiple plots inside one figure and struggled looping with rotate.
Tried looping view() and for now im happy with something like that:
for ii=1:720
view(ii,0)
pause(0.2)
end

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by