代码如下:
1 // Construct the default list of terrain sources. 2 var terrainModels = Cesium.createDefaultTerrainProviderViewModels(); 3 4 // Construct the viewer with just what we need for this base application 5 var viewer = new Cesium.Viewer(‘cesiumContainer‘, { 6 timeline:false, 7 animation:false, 8 vrButton:true, 9 sceneModePicker:false, 10 infoBox:true, 11 scene3DOnly:true, 12 terrainProviderViewModels: terrainModels, 13 selectedTerrainProviderViewModel: terrainModels[1] // Select STK high-res terrain 14 }); 15 16 // No depth testing against the terrain to avoid z-fighting 17 viewer.scene.globe.depthTestAgainstTerrain = false; 18 19 var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ 20 url: ‘../static/resource/jiangShanModel/Production_3.json‘, 21 maximumScreenSpaceError: 2, 22 maximumNumberOfLoadedTiles: 1000 23 }));
坑来了!!!!
一定要注意使用的cesium的版本,因为我加载了地形之后,倾斜摄影模型一直与地形有相交的部分,最后发现是引用的cesium.js的版本问题》》
原文地址:https://www.cnblogs.com/dongzhiwu/p/9210985.html
时间: 2024-10-16 03:37:39