Getting camera viewing data in real time

4 visualizaciones (últimos 30 días)
Pelajar UM
Pelajar UM el 18 de Mzo. de 2022
Editada: Konrad el 18 de Mzo. de 2022
Is there a way to get the following data from a 3D plot in real time as I move the view?
app.UIAxes.View;
app.UIAxes.CameraPosition;
app.UIAxes.CameraTarget;
app.UIAxes.CameraUpVector;
app.UIAxes.CameraViewAngle;
Basically I want to adjust the view on a single plot and then pass the data to other plots. So that I don't have to adjust them one by one.

Respuesta aceptada

Konrad
Konrad el 18 de Mzo. de 2022
Editada: Konrad el 18 de Mzo. de 2022
Hi,
you can link the Camera-properties of the axes:
figure; ah(1) = axes;
figure; ah(2) = axes;
plot3(ah(1),rand(10,1),rand(10,1),rand(10,1),'*');
plot3(ah(2),rand(10,1),rand(10,1),rand(10,1),'*');
linkprop(ah,{'CameraPosition','CameraTarget','CameraUpVector','CameraViewAngle'});
EDIT:
It seems that zooming behaves odd using the above code (with 'CameraUpVector' and 'CameraViewAngle'). To synchronize zooming better use:
linkprop(ah,{'CameraPosition','CameraTarget','Xlim','Ylim','ZLim'});
Best, Konrad

Más respuestas (0)

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by