This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Rotate camera target around camera position




campan(dtheta,dphi) rotates the camera target of the current axes 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:

  • 'data' (default) — Rotate the camera target around an axis defined by the camera position and the direction (default is the positive z direction)

  • 'camera' — Rotate the camera about the point defined by the camera target.

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 options, 'x', 'y', or 'z', to indicate [1 0 0], [0 1 0], or [0 0 1] respectively.

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


collapse all

Move the camera target to pan the object in a circular motion.

axis vis3d
hPan = sin(-pi:1:pi);
vPan = cos(-pi:1:pi);
for k = 1:length(hPan)

Introduced before R2006a

Was this topic helpful?