固定剖面

剖面暂时写的是通过绑定属性clippingPlanes形成的,辅助面自己画出来想通过boundingSphere.center定位 但是一直不对。

Cesium3DTileset本以为是通过boundingSphere.center去剖切的 其实是通过root.transform的数据去绑定的。

let p = Cesium.Matrix4.getTranslation(tileset.root.transform,new Cesium.Cartesian3());

this.addplane(p, viewer)

addplane(p, viewer) {

      function updatedimension() {

        let long = viewer.camera.positionCartographic.height.toFixed(2);

        return new Cesium.Cartesian2(long * 0.4, long * 0.4);

      }

      let plane = viewer.entities.add({

        name: "辅助面",

        position: p,

        plane: {

          plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0),

          material: Cesium.Color.WHITE.withAlpha(0.1),

          fill: true,

          outline: true,

          outlineColor: Cesium.Color.WHITE,

        },

      });

      plane.plane.dimensions = new Cesium.CallbackProperty(

        updatedimension,

        false

      );

      return plane;

    },

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容