Cesium 场景保存与恢复

position = viewer.camera.positionWC.clone();
up = viewer.camera.up.clone();
direction = viewer.camera.direction.clone();
flyHome() {
      let that this;
      viewer.camera.flyTo({
        destination: new Cesium.Cartesian3(
          that.homePos.position.x,
          that.homePos.position.y,
          that.homePos.position.z
        ),
        orientation: {
          direction: new Cesium.Cartesian3(
            that.homePos.direction.x,
            that.homePos.direction.y,
            that.homePos.direction.z
          ),
          up: new Cesium.Cartesian3(
            that.homePos.up.x,
            that.homePos.up.y,
            that.homePos.up.z
          )
        }
      });
    },

 

posted on 2021-08-12 10:53  苹果园dog  阅读(317)  评论(0编辑  收藏  举报

导航