• ceisum_加载倾斜摄影模型


      osgb转换为3Dtiles格式(使用工具转换)

      然后加载到cesium中(加载代码见下,可以控制模型高度)

      

    var offset = function(height,tileset) {
      console.log(height);
      height = Number(height);
      if (isNaN(height)) {
        return;
      }
      var cartographic = Cesium.Cartographic.fromCartesian(tileset.boundingSphere.center);
      var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
      var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height);
      var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
      tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
    };
    // 加载倾斜摄影模型
    var tileset = new Cesium.Cesium3DTileset({ url: '/' });
    tileset.readyPromise.then(function(tileset) {
      viewer.scene.primitives.add(tileset);
      offset(100,tileset);
      var boundingSphere = tileset.boundingSphere;
      viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0.0, -0.5, boundingSphere.radius));
      viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
    }).otherwise(function(error) {
      console.log(error);
    });
  • 相关阅读:
    洛谷 P1057 传球游戏
    BZOJ 1801: [Ahoi2009]chess 中国象棋
    BZOJ 1806: [Ioi2007]Miners 矿工配餐
    51nod 1276 岛屿的数量
    BZOJ 1800: [Ahoi2009]fly 飞行棋
    路由控制和视图层
    django的零碎注意点
    Django框架简介
    Bootstrap框架
    jQuery基础知识
  • 原文地址:https://www.cnblogs.com/dongzhiwu/p/9052230.html
Copyright © 2020-2023  润新知