Position the camera to view an object or group of objects
Syntax
camlookat(h)
camlookat(axes_handle)
camlookat
Description
camlookat(handles)
views the objects identified in the vector handles
. The vector can contain the handles of Axes children.
camlookat(axes_handle)
views the objects that are children of the Axes identified by axes_handle
.
camlookat
views the objects that are in the current Axes.
Remarks
camlookat
moves the camera position and camera target while preserving the relative view direction and camera view angle. The object (or objects) being viewed roughly fill the axes position rectangle.
camlookat
sets the Axes CameraPosition
and CameraTarget
properties.
Examples
This example creates three spheres at different locations and then progressively positions the camera so that each sphere is the object around which the scene is composed:
[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
camlookat(gca) % Compose the scene around the current axes
pause(2)
camlookat(s1) % Compose the scene around sphere s1
pause(2)
camlookat(s2) % Compose the scene around sphere s2
pause(2)
camlookat(s3) % Compose the scene around sphere s3
pause(2)
camlookat(gca)
See Also
campos
, camtarget
[ Previous | Help Desk | Next ]