主要内容

本页采用了机器翻译。点击此处可查看英文原文。

lightm

在基于 axesm 的地图上投射光效

语法

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

说明

h = lightm(lat,lon) 在坐标 latlon 处投影出一个光体。可以返回该对象的句柄 h

h = lightm(lat,lon,PropertyName,PropertyValue,...) 允许指定标准 MATLAB® light 函数支持的任何属性名称-值对。

h = lightm(lat,lon,alt) 允许为灯光对象指定高度 (alt)。如果未指定,则默认光照源高度为无穷大。

示例

全部折叠

加载高程栅格数据和地理单元参考对象。使用基于 axesm 的地图创建一个球体框架。

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

显示数据,并应用适合海拔数据的颜色图。

meshm(topo60c,topo60cR)
demcmap(topo60c)

通过指定纬度、经度和颜色,为球体添加灯光效果。使用 material 函数设置反射率属性。使用 lighting 函数更改照明方法。

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.

添加一个使用不同颜色的第二光源。

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

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

版本历史记录

在 R2006a 之前推出

另请参阅