Create or move light object in camera coordinates
light_handle = camlight(...)
local (default) — The light is a point source that radiates from the location in all directions.
infinite — The light shines in parallel rays.
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