Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

camorbit

围绕相机目标旋转相机

语法

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

说明

camorbit(dtheta,dphi) 围绕相机目标将相机位置旋转 dthetadphi(均以度为单位)中的指定距离。dtheta 是水平旋转,dphi 是垂直旋转。

camorbit(dtheta,dphi,'coordsys') 围绕相机目标旋转相机位置,并使用 coordsys 参数确定旋转中心。coordsys 可采用两个值:

  • data(默认值)- 围绕相机目标和 direction(默认值为正 z 方向)定义的轴旋转相机。

  • camera - 将相机旋转约相机目标定义的点数。

camorbit(dtheta,dphi,'coordsys','direction') 通过配合使用 direction 参数和相机目标来为数据坐标系定义旋转轴。将 direction 指定为包含方向的 xyz 分量的三元素向量或选项 xyz 之一,以便分别指示 [1 0 0][0 1 0][0 0 1]

camorbit(axes_handle,...) 在第一个参数 axes_handle 标识的坐标区上操作。不指定坐标区句柄时,camorbit 在当前坐标区上操作。

camorbitrotate3d 函数行为的区别在于,rotate3d 工具修改坐标区的 View 属性,而 camorbit 函数固定纵横比并修改坐标区的 CameraTargetCameraPositionCameraUpVector 属性。有关坐标区属性的详细信息,请参阅 Axes 属性

示例

全部折叠

围绕相机目标点定义的线条按与 y 轴平行的方向水平旋转相机。可将此旋转可视化为一个圆锥体,相机目标位于顶点,相机位置构成锥底。

surf(peaks)
axis vis3d

for i = 1:36
   camorbit(10,0,'data',[0 1 0])
   drawnow
end

在相机坐标系中旋转,以使相机围绕坐标区沿着圆圈移动,保持圆心位于相机目标处。

surf(peaks)
axis vis3d

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

备选方法

使用图窗的工具菜单或图窗工具栏启用三维旋转。

版本历史记录

在 R2006a 之前推出