Main Content

lightm

Project light objects on axesm-based map

Syntax

h = lightm(lat,lon)
h = lightm(lat,lon,PropertyName,PropertyValue,...)
h = lightm(lat,lon,alt)

Description

h = lightm(lat,lon) projects a light object at the coordinates lat and lon. The handle, h, of the object can be returned.

h = lightm(lat,lon,PropertyName,PropertyValue,...) allows the specification of any property name/property value pair supported by the standard MATLAB® light function.

h = lightm(lat,lon,alt) allows the specification of an altitude, alt, for the light object. When omitted, the default is an infinite light source altitude.

Examples

collapse all

Load elevation raster data and a geographic cells reference object. Create a globe frame by using an axesm-based map.

load topo60c
axesm globe
view(120,30)
axis off

Display the data and apply a colormap appropriate for elevation data.

meshm(topo60c,topo60cR)
demcmap(topo60c)

Add light to the globe by specifying a latitude, longitude, and color. Set reflectance properties by using the material function. Change the lighting method using the lighting function.

lightm(0,90,'Color','y')
material([.5 .5 1])
lighting gouraud

Figure contains an axes object. The hidden axes object contains an object of type surface.

Add a second light source that uses a different color.

lightm(90,0,'Color','m')

Figure contains an axes object. The hidden axes object contains an object of type surface.

Version History

Introduced before R2006a

See Also