WebGl创建entity线如何贴地

0 投票
viewer.entities.add({

  polyline: {

    positions: Cesium.Cartesian3.fromDegreesArray(coordinateLineFromDegreesArray),

    shape: [new Cesium.Cartesian2(-5, -5),

                new Cesium.Cartesian2(5, -5),

                new Cesium.Cartesian2(5, 5),

                new Cesium.Cartesian2(-5, 5)],

    cornerType: Cesium.CornerType.BEVELED,

    material: Cesium.Color.GREEN.withAlpha(0.5),

    outline: true,

    outlineColor: Cesium.Color.BLACK,

  },

  parent: PipesEntity,

});

用上面的方法添加entity线,如何设置贴地形。
11月 24, 2017 分类:  2462次浏览 | 用户: 18214558240 初出茅庐 (57 分)

1个回答

0 投票

您好,您可以参考下这篇博客:http://blog.csdn.net/u013929284/article/details/52653084

9.其他问题②贴地线

11月 27, 2017 用户: 张阳名 登峰造极 (5,560 分)
那面呢,,我用这个方法给面的点设置高度,是不行,,因为点是贴着地了,,面也在地形上面的了,但是没有紧密的贴着地。
矢量面贴地的代码 //自定义polygon
        var polygon = viewer.entities.add({
            polygon : {
                hierarchy : {
                    positions : [new Cesium.Cartesian3(290254.5148736448,5637924.074937166,2971777.4768239637),
                        new Cesium.Cartesian3(286432.14053509803,5640804.651089405,2966391.9275969476),
                        new Cesium.Cartesian3(283512.2666752818,5640502.494127799,2969385.3689191523),
                        new Cesium.Cartesian3(287036.36797237827,5636827.146248645,2974105.8904601005)]
                },
                material : Cesium.Color.BLUE.withAlpha(0.5)
            }
        });
...