MATLAB Function Reference Previous page   Next Page

Position the camera to view an object or group of objects



camlookat(object_handles) views the objects identified in the vector object_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.


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.


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:

See Also

campos, camtarget

Controlling the Camera Viewpoint for related functions

Defining Scenes with Camera Graphics for more information

Previous page  camlight camorbit Next page

© 1994-2005 The MathWorks, Inc.