美文网首页
Cesium如何开启第一人称视角(第三视角)漫游

Cesium如何开启第一人称视角(第三视角)漫游

作者: 懵懵懂懂_YOYO | 来源:发表于2022-11-16 15:51 被阅读0次

    第一人称视角漫游
    官网教程:https://sandcastle.cesium.com/?src=Camera.html
    参考:https://blog.csdn.net/xietao20/article/details/109403005(Cesium第一人称漫游)

     public losAngelesToDestination(adjustPitch: boolean) {
        const camera = this.scene.camera;
    
        const destinationOptions = {
          destination: Cartesian3.fromDegrees(121.506377, 31.245105, 3000.0),
          orientation: {
            heading: Math.toRadians(-15.0),
            pitch: -Math.PI_OVER_FOUR,
            roll: 0.0
          },
          duration: 20,
          // flyOverLongitude: Math.toRadians(30.0),
          pitchAdjustHeight: 0
        };
    
        const laOptions = {
          destination: Cartesian3.fromDegrees(120.2723, 30.3362, 10000.0),
          duration: 5,
          orientation: {
            heading: Math.toRadians(-15.0),
            pitch: -Math.PI_OVER_FOUR,
            roll: 0.0
          },
          pitchAdjustHeight: 0,
          complete: function () {
            callback();
          }
        };
    
        laOptions.complete = function () {
          setTimeout(function () {
            camera.flyTo(destinationOptions);
          }, 1000);
        };
    
        if (adjustPitch) {
          tokyoOptions.pitchAdjustHeight = 1000;
          laOptions.pitchAdjustHeight = 1000;
        }
    
        camera.flyTo(laOptions);
      }
    

    相关文章

      网友评论

          本文标题:Cesium如何开启第一人称视角(第三视角)漫游

          本文链接:https://www.haomeiwen.com/subject/avwyxdtx.html