camtarget resets when using mouse to rotate 3D figure

조회 수: 3 (최근 30일)
John Mahoney
John Mahoney 2014년 12월 4일
댓글: Javier Ros 2025년 2월 26일
Often when I have a 3D plot, I want to zoom in on some feature and view it from different angles. Currently, I:
  • click the rotate tool
  • rotate the figure to where I think it will be useful
  • click the zoom tool
  • zoom in until I get close enough
  • double click to reset the view
  • repeat
The reason for resetting each time is that once zoomed in, using the rotate tool to gain another perspective often rotates the object of interest far out of view. As I understand, this is because the camera center is not set to the location of the object of interest. (This makes sense, although Matlab might assume that it is in the center of the panel I have zoomed in on, maybe with some estimate of depth?)
The apparent solution is to set camtarget to the location of the object of interest. camtarget([0.2, 0.3, 5])
However, for some reason camtarget is reset when you use the rotate tool to rotate the figure. This seems like a bug.
I searched for some way to change this resetting behavior. I thought it might be changing the camtargetMODE, but using the rotate tool resets this too.
Any help is much appreciated. Cheers- John
  댓글 수: 1
Javier Ros
Javier Ros 2025년 2월 26일
There is a work arround here.
https://es.mathworks.com/matlabcentral/answers/96829-how-can-i-change-the-center-of-rotation-while-using-rotate3d-icon-in-the-figure-window-in-matlab-7-4#answer_106180
But this should be documented along with camtarget if they don't intend to change behavior

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactions, Camera Views, and Lighting에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by