3-D Visualization |
Revolving Around the Scene
You can use the view
command to revolve the viewpoint about the z-axis by varying the azimuth, and about the azimuth by varying the elevation. This has the effect of moving the camera around the scene along the surface of a sphere whose radius is the length of the viewing axis. You could create the same effect by changing the CameraPosition
, but doing so requires you to perform calculations that MATLAB performs for you when you call view
.
For example, the function orbit
moves the camera around the scene.
function orbit(deg) [az el] = view; rotvec = 0:deg/10:deg; for i = 1:length(rotvec) view([az+rotvec(i) el]) drawnow end
Making the Scene Larger or Smaller | Rotation Without Resizing of Graphics Objects |
© 1994-2005 The MathWorks, Inc.