当前位置:网站首页>Cesium Quick Start 4-Polylines primitive usage explanation

Cesium Quick Start 4-Polylines primitive usage explanation

2022-08-10 15:32:00 Debt in the world^

1. Polyline & Cesium.PolylineCollection

http://localhost:8080/Apps/Sandcastle/index.html?src=development%2FPolylines.html&label=Development
在这里插入图片描述

  // A simple polyline with two points.
  const polyline = polylines.add({
    
    positions: Cesium.PolylinePipeline.generateCartesianArc({
    
      positions: Cesium.Cartesian3.fromDegreesArray([
        -120.0,
        40.0,
        -110.0,
        30.0,
      ]),
    }),
    material: Cesium.Material.fromType("Color", {
    
      color: new Cesium.Color(1.0, 1.0, 1.0, 1.0),
    }),
  });

2. PolylineGeometry

http://localhost:8080/Apps/Sandcastle/gallery/development%2FPolyline.html
在这里插入图片描述

3. SimplePolylineGeometry

http://localhost:8080/Apps/Sandcastle/index.html?src=development%2FSimple%20Polyline.html&label=Development
在这里插入图片描述
特点:SimplePolylineGeometry没有width属性

4. GroundPolylineGeometry

http://localhost:8080/Apps/Sandcastle/gallery/development%2FGround%20Polyline%20Material.html
在这里插入图片描述
http://localhost:8080/Apps/Sandcastle/gallery/development%2FPolylines%20On%20Terrain.html
在这里插入图片描述
注意:必须用GroundPolylinePrimitive来创建,而不能用GroundPrimitive创建

5. 综合比较

PolylineCollectionMultiple polylines can be rendered at the same time,性能较高;Other types render a polyline separately,Will lead to more words,Rendering performance is affected.

原网站

版权声明
本文为[Debt in the world^]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/222/202208101459158263.html