Documentation

campan

旋转相机目标基于“增大化现实”技术ound camera position

Syntax

campan(dtheta,dphi)
campan(dtheta,dphi,coordsys)
campan(dtheta,dphi,coordsys,direction)
campan(ax,...)

Description

campan(dtheta,dphi)rotates the camera target of the current axes around the camera position by the amounts specified indthetaanddphi(both in degrees).dthetais the horizontal rotation anddphiis the vertical rotation.

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

  • 'data'(default) — Rotate the camera target around an axis defined by the camera position and thedirection(default is the positivezdirection)

  • '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 thedirectionargument with the camera position. Specifydirectionas a three-element vector containing thex-,y-, andz-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(ax,...)operates on the axes identified by the first argument,ax. When you do not specify an axes object,campanoperates on the current axes.

Examples

collapse all

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

sphere; axisvis3dhPan = sin(-pi:1:pi); vPan = cos(-pi:1:pi);fork = 1:length(hPan) campan(hPan(k),vPan(k)) pause(.1)end

Introduced before R2006a

Was this topic helpful?