I can't seem to achieve the following 3D plot view orientation using the view([AZ,EL])
command.
No matter how hard I try rotating my 3D plot in the figure using the mouse or the command view
itself, I just can't get that viewing angle. Is there another way of specifying the viewpoint?
You can achieve these sorts of views using camera control functions, in this case camorbit
and camroll
:
[X, Y, Z] = peaks();
hAxes = gca;
surf(hAxes, X, Y, Z);
xlabel('x');
ylabel('y');
zlabel('z');
camorbit(-90, 0);
camroll(hAxes, -111);
Notice that positive x is pointing up and to the right, positive z is pointing down and to the right, and positive y is pointing up.
I've done a lot of 3D visualization in MATLAB, and have put together some tools I routinely use for manipulating the view with the mouse. I posted one such tool on the MathWorks File Exchange called MouseManager
. One of the demos I included in the submission is an example for how to create mouse-based manipulation of the view (rotating, dollying, and zooming).
来源:https://stackoverflow.com/questions/43479327/impossible-viewpoint-using-azimuth-and-elevation