zoukankan      html  css  js  c++  java
  • cesium动态水面(水面几何挖洞)

    转载请认注明出处

    animatingWater() {
        let viewer = this.props.viewer;
        //河道多边形
        let position = Cesium.Cartesian3.fromDegreesArray(riverArray);
        let holes = Cesium.Cartesian3.fromDegreesArray(holesArray);
        var x = {
          positions: position,
          //由于挖的这个洞,是x本身的一种数组集合,所以每一个对象里,又是一个x的形式
          holes: [{ positions: holes }]
        };
        // // new Cesium.PolygonHierarchy(),
        var polygon1 = new Cesium.PolygonGeometry({
          polygonHierarchy: x,
          // hierarchy:x,
          // extrudedHeight:0, //与height不能同时存在,否则height不生效
          height: 19.0,
          // perPositionHeight:false,
          // outline: true,
          // outlineWidth: 100,
          // fill: false,
          // arcType: Cesium.ArcType.RHUMB,
          // material: Cesium.Color.RED,
          vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
        });
        River1 = new Cesium.Primitive({
          geometryInstances: new Cesium.GeometryInstance({
            geometry: polygon1
          }),
          appearance: new Cesium.EllipsoidSurfaceAppearance({
            aboveGround: true
          }),
          show: true
        });
        var River1_Material = new Cesium.Material({
          fabric: {
            type: 'Water',
            uniforms: {
              // baseWaterColor:new Cesium.Color('#1E90FF'),00BFFF #40E0D0
              blendColor: new Cesium.Color("#008B45"),
              normalMap: waterNormals,
              frequency: 100.0,
              animationSpeed: 0.005,
              amplitude: 10.0,
            }
          }
        });
        River1.appearance.material = River1_Material;
        viewer.scene.primitives.add(River1);
      }
    //水体坐标格式
     const riverArray = [
        123.3, 34.3, 123.4, 33.3]
     const holesArray = [
        123.3, 33.5, 123.8, 33.9]
     
    
  • 相关阅读:
    Eclipse 插件安装、升级和卸载的方法
    Eclipse中Spring插件的安装
    为eclipse离线安装hibernate tools插件
    Eclipse中Hibernate插件的安装
    Nginx安装配置
    app自动更新(android)
    PhoneGap应用图标icon和启动页面SplashScreen
    highcharts图表的图例legend
    安装android的sdk
    设置全屏
  • 原文地址:https://www.cnblogs.com/marvelousone/p/11408271.html
Copyright © 2011-2022 走看看