2 synchronized objects in viewer3d

7 次查看(过去 30 天)
Andre Stiel
Andre Stiel 2024-1-12
编辑: Walter Roberson about 17 hours 前
(Running Matlab 2023b)
Dear Community,
how can I have two volshow objects side by side in viewer3d that follow the same rotation/zoom commands via mouse?
Or how can I have two viewer3d that have linked mouse commands?
In essence I am looking for a functionality like "linkaxes" only for viewer3d
Where to look?
Many thanks,
André

回答(2 个)

Tim Jackman
Tim Jackman about 18 hours 前
编辑:Walter Roberson about 17 hours 前
The most performant way to achieve this is listening to the CameraMoving and/or CameraMoved events on both Viewer3d objects and in the callback updating the other viewer with the camera properties. No additional work should be required to enable interactive rotation (rotate3d won’t work here, but shouldn’t be required anyway). See this page for a little more information on the events that are broadcast when the user interactively moves the camera:

Florian Bidaud
Florian Bidaud 2024-1-12
Hi, I think you should be able to use linkprop on your two 3D-viewer objects.
  2 个评论
Andre Stiel
Andre Stiel 2024-1-12
thanks - great works. linking the viewer objects with "linkprop" indeed does the trick
Andre Stiel
Andre Stiel 2024-5-16
Dear Florian,
I am sorry but i need to inquire a bit more:
When the two viewers are open
I can align the one to the other with calling hlink = linkprop([viewer,viewer2],{'CameraPosition','CameraUpVector'});
However, "rotate3d on" does not allow me to do that inetractively (!).
In general "linkprop" "rotate3d on" works interactively I tried with the example code from the linkprop doc. But there the two plots are subplot within one image.
Am I missing something? I make two independent "viewers3d" with each a volshow with the viewer as respective parent.
"linkprop" also has the two viewers as targets but as said interactive rotation does not work.
Many thanks.
André

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by