加载模型
this.tileset2 = new Cesium.Cesium3DTileset({
url: "http://localhost:9998/test/tileset.json",
maximumScreenSpaceError: 16,
preferLeaves: true,
skipLevelOfDetail: true,
baseScreenSpaceError: 1024,
skipScreenSpaceErrorFactor: 16,
skipLevels: 1,
immediatelyLoadDesiredLevelOfDetail: false,
loadSiblings: false,
cullWithChildrenBounds: true,
show: true,
});
this.viewer.scene.primitives.add(this.tileset2);
平移和修改高度
方法一:
const tileset = this.tileset2;
let offsetHeight=0;//需要调整的高度
var boundingSphere = tileset.boundingSphere;//3dtile的边界
var xoffect = 0.001;//x轴坐标平移量
var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);// 将笛卡尔坐标转换为地理坐标(弧度)
var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height);
var offset =