当前位置:   article > 正文

cesium两种方式添加发光贴地线_cesium 发光线

cesium 发光线

一:实体entity

  1. viewer.entities.add({
  2. name:"",
  3. polyline: {
  4. positions: Cesium.Cartesian3.fromDegreesArrayHeights([104.57311103029339,30.71454550939871,451.0205115032204,104.57369073762032,30.71350155773247,437.4264690503778,104.57414650599235,30.7135714014856,444.54897812734873,104.5740256006362,30.714837602541927,448.69868845044147,104.57483833991859,30.72413178951584,445.16245273847795]),
  5. width: 15,
  6. material: new Cesium.PolylineGlowMaterialProperty({
  7. glowPower: 0.1,
  8. color: Cesium.Color.fromCssColorString('#ff0000')
  9. }),
  10. clampToGround: true,
  11. },
  12. });

二:图元primitives

  1. let instance = new Cesium.GeometryInstance({
  2. geometry : new Cesium.GroundPolylineGeometry({//贴地折线geomotry类
  3. positions : Cesium.Cartesian3.fromDegreesArrayHeights([104.57311103029339,30.71454550939871,451.0205115032204,104.57369073762032,30.71350155773247,437.4264690503778,104.57414650599235,30.7135714014856,444.54897812734873,104.5740256006362,30.714837602541927,448.69868845044147,104.57483833991859,30.72413178951584,445.16245273847795]),
  4. width : 18.0
  5. })
  6. });
  7. let groundPolylinePrimitive = new Cesium.GroundPolylinePrimitive({//贴地折线primitive类
  8. geometryInstances : instance,
  9. appearance : new Cesium.PolylineMaterialAppearance({
  10. material: new Cesium.Material({
  11. fabric : {
  12. type : Cesium.Material.PolylineGlowType,
  13. uniforms: {
  14. color: Cesium.Color.fromCssColorString('#0000ff'),
  15. glowPower:0.1,
  16. }
  17. }
  18. })
  19. })
  20. });
  21. viewer.scene.primitives.add(groundPolylinePrimitive);

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/109527
推荐阅读
相关标签
  

闽ICP备14008679号