SuperMap iClient3D for WebGL教程-C
2019-05-29 本文已影响0人
Mr桔子先生
CorridorGraphics对象是一个不常用的对象,直译过来称之为走廊对象,相对比较难理解,该对象小编理解为线的面缓冲区对象,下图中黄线是中心线,从此可以理解,该对象实际是一个polygonGraphics。

下面我们来看下CorridorGraphics的属性:

positions:中心线节点坐标
width:缓冲区半径
cornerType:转角类型,包括圆角、直角、和切角
height:底部高程
heightReference:高度模式
extrudedHeight:拉伸到的高程
extrudedHeightReference:拉伸到的高度模式,与高度模式相同
granularity:粒度,单位经纬度之间规定距离数值(具体是啥作用小编也没测试出来)
distanceDisplayCondition:最大最小可见距离
下面来看下几个属性的具体用法
cornerType转角类型:
Cesium.CornerType.ROUNDED,圆角
Cesium.CornerType.MITERED,直角
Cesium.CornerType.BEVELED,切角
加载效果如下

前面小编已经讲了该对象其实是个面对象,所以可以对该对象进行拉伸和贴图。
var redCorridor = viewer.entities.add({
name: 'Red corridor on surface with rounded corners',
corridor: {
positions: Cesium.Cartesian3.fromDegreesArray([
-100.0, 40.0,
-105.0, 40.0,
-105.0, 35.0
]),
width: 200000.0,
granularity:3,
height:20000,
extrudedHeight:0,
//heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,
//material: Cesium.Color.RED.withAlpha(0.5)
material: 'Corridor.jpg'
}
});

CorridorGraphics的使用就先介绍到这里,小节教程再见。