MATLAB Function Reference Previous page   Next Page

Create or move a light object in camera coordinates



camlight('headlight') creates a light at the camera position.

camlight('right') creates a light right and up from camera.

camlight('left') creates a light left and up from camera.

camlight with no arguments is the same as camlight('right').

camlight(az,el) creates a light at the specified azimuth (az) and elevation (el) with respect to the camera position. The camera target is the center of rotation and az and el are in degrees.

camlight(...,'style') The style argument can take on two values:

camlight(light_handle,...) uses the light specified in light_handle.

light_handle = camlight(...) returns the light's handle.


camlight sets the light object Position and Style properties. A light created with camlight will not track the camera. In order for the light to stay in a constant position relative to the camera, you must call camlight whenever you move the camera.


This example creates a light positioned to the left of the camera and then repositions the light each time the camera is moved:

See Also

light, lightangle

Lighting for related functions

Lighting as a Visualization Tool for more information on using lights

Previous page  cameratoolbar camlookat Next page

© 1994-2005 The MathWorks, Inc.