MATLAB Function Reference | Search  Help Desk |
camdolly | Examples See Also |
Move the camera position and target
camdolly(dx,dy,dz) camdolly(dx,dy,dz,'targetmode
') camdolly(dx,dy,dz,'targetmode
','coordsys
') camdolly(axes_handle,...)
camdolly
moves the camera position and the camera target by the specified amounts.
camdolly(dx,dy,dz)
moves the camera position and the camera target by the specified amounts (see Coordinate Systems).
camdolly(dx,dy,dz,'targetmode
')
The targetmode
argument can take on two values that determine how MATLAB moves the camera:
movetarget
(default) - move both the camera and the target
fixtarget
- move only the camera
camdolly(dx,dy,dz,'targetmode
','coordsys
')
The coordsys
argument can take on three values that determine how MATLAB interprets dx
, dy
, and dz
:
camera
(default) - move in the camera's coordinate system. dx
moves left/right, dy
moves down/up, dz
moves along the viewing axis. The units are normalized to the scene.
For example, setting dx
to 1 moves the camera to the right, which pushes the scene to the left edge of the box formed by the axes position rectangle. A negative value moves the scene in the other direction. Setting dz
to .5 moves the camera to a position half way in between the camera position and the camera target
dx
and dy
as pixel offsets. dz
is ignored.
dx
, dy
, and dz
in axes data coordinates.
camdolly(axes_handle,...)
operates on the axes identified by the first argument, axes_handle
. When you do not specify an axes handle, camdolly
operates on the current axes.
camdolly
sets the Axes CameraPosition
and CameraTarget
properties, which in turn causes the CameraPositionMode
and CameraTargetMode
properties to be set to manual.
This example moves the camera along the x- and y-axes in a series of steps:
surf(peaks)axis
vis3d t = 0:pi/20:2*pi; dx = sin(t)./40; dy = cos(t)./40;for i = 1:length(t);
camdolly(dx(i),dy(i),0)drawnow
end
axes
, campos
, camproj
, camtarget
, camup
, camva
The Axes properties CameraPosition
, CameraTarget
, CameraUpVector
, CameraViewAngle
, Projection
The "Camera Properties" section in the Using MATLAB Graphics manual