Skip to Main Content Skip to Search
Product Documentation

camdolly - Move camera position and target

Syntax

camdolly(dx,dy,dz)
camdolly(dx,dy,dz,'targetmode')
camdolly(dx,dy,dz,'targetmode','coordsys')
camdolly(axes_handle,...)

Description

camdolly(dx,dy,dz) moves the camera position and the camera target by the specified amounts dx, dy, and dz.

camdolly(dx,dy,dz,'targetmode') uses the targetmode argument to determine how the camera moves:

camdolly(dx,dy,dz,'targetmode','coordsys') uses the coordsys argument to determine how MATLAB interprets dx, dy, and dz:

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 sets the CameraPositionMode and CameraTargetMode properties to manual.

Examples

Move 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

See Also

axes | Axes CameraPosition property | Axes CameraTarget property | Axes CameraUpVector property | Axes CameraViewAngle property | Axes Projection property | campos | camproj | camtarget | camup | camva

How To

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS