Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

campan - Rotate camera target around camera position

Syntax

campan(dtheta,dphi)
campan(dtheta,dphi,'coordsys')
campan(dtheta,dphi,'coordsys','direction')
campan(axes_handle,...)

Description

campan(dtheta,dphi) rotates the camera target around the camera position by the amounts specified in dtheta and dphi (both in degrees). dtheta is the horizontal rotation and dphi is the vertical rotation.

campan(dtheta,dphi,'coordsys') determine the center of rotation using the coordsys argument. It can take on two values:

campan(dtheta,dphi,'coordsys','direction') defines the axis of rotation for the data coordinate system using the direction argument with the camera position. Specify direction as a three-element vector containing the x-, y-, and z-components of the direction or one of the characters, x, y, or z, to indicate [1 0 0], [0 1 0], or [0 0 1] respectively.

campan(axes_handle,...) operates on the axes identified by the first argument, axes_handle. When you do not specify an axes handle, campan operates on the current axes.

Examples

Rotate in the camera coordinate system to orbit the object along a circle while keeping the center of the circle at the camera position:

surf(peaks)
axis vis3d
for i=1:36
	camorbit(10,0,'camera')
	drawnow
end

See Also

axes | camdolly | camorbit | camroll | camtarget | camzoom

How To

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS