Main Content

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

camlookat

定位相机以查看对象或对象组

语法

camlookat(object_handles)
camlookat(axes_handle)
camlookat

说明

camlookat(object_handles) 查看向量 object_handles 中标识的对象。向量可包含坐标区 Children 的句柄。

camlookat(axes_handle) 查看作为 axes_handle 标识的坐标区的子级的对象。

camlookat 通过在保留相对查看方向和相机查看角度时移动相机未知和相机目标来查当前坐标区中的对象。查看的对象大体上填充坐标区位置矩形。要更改视图,请使用 camlookat 设置坐标区的 CameraPositionCameraTarget 属性。

示例

全部折叠

创建三个球面。然后设置数据纵横比、视图和投影类型。

[x,y,z] = sphere;
s1 = surf(x,y,z);
hold on
s2 = surf(x+3,y,z+3);
s3 = surf(x,y,z+6);

daspect([1 1 1])
view(30,10)
camproj perspective

Figure contains an axes object. The axes object contains 3 objects of type surface.

将场景对准球面 s1

camlookat(s1)

Figure contains an axes object. The axes object contains 3 objects of type surface.

将场景对准球面 s2

camlookat(s2)

Figure contains an axes object. The axes object contains 3 objects of type surface.

将场景对准球面 s3

camlookat(s3)

Figure contains an axes object. The axes object contains 3 objects of type surface.

版本历史记录

在 R2006a 之前推出