| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
camlight('headlight')
camlight('right')
camlight('left')
camlight
camlight(az,el)
camlight(...,'style')
camlight(light_handle,...)
light_handle = camlight(...)
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') defines the style argument using one of two values:
local (default) — The light is a point source that radiates from the location in all directions.
infinite — The light shines in parallel rays.
camlight(light_handle,...) uses the light specified in light_handle.
light_handle = camlight(...) returns the light object handle.
camlight sets the light object Position and Style properties. A light created with camlight does not track the camera. In order for the light to stay in a constant position relative to the camera, call camlight whenever you move the camera.
Create a light positioned to the left of the camera and then reposition the light each time the camera moves:
surf(peaks)
axis vis3d
h = camlight('left');
for i = 1:20;
camorbit(10,0)
camlight(h,'left')
drawnow;
end
![]() | cameratoolbar | camlookat | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2010- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |