首页 / 浏览问题 / 三维GIS / 问题详情
supermap iclien3d for cesium 11i 替换天空盒失败
YE1
5EXP 2024年03月18日
 const qingtianSkyBox=new Cesium.SkyBox({
     nearGround:true,
     sources:{
       positiveX:'../assets/天空盒素材/Right.png',
       negativeX:'../assets/天空盒素材/Left.png',
       positiveY:'../assets/天空盒素材/Front.png',
       negativeY:'../assets/天空盒素材/Back.png',
       positiveZ:'../assets/天空盒素材/Up.png',
      negativeZ:'../assets/天空盒素材/Down.png',
      
    }
   })
       const defaultSkyBox=viewer.scene.skyBox
       const currentSkyBox=qingtianSkyBox
       scene.skyBox=currentSkyBox
       scene.postRender.addEventListener(function() {
                  var cameraHeight = scene.camera.positionCartographic.height;
                  var toggleHeight = 23e4;
                  if(cameraHeight < toggleHeight && Cesium.defined(currentSkyBox)) {
                     scene.skyBox = currentSkyBox;
                     scene.skyAtmosphere.show = false;
                    }  else {
                       scene.skyBox = defaultSkyBox;
                       scene.skyAtmosphere.show = true;
                     }
                });

参考官网示例修改的天空盒,星空正常加载,近地面天空盒变为纯黑色,没有加载出我的素材,控制台也没有报错

1个回答

您好,建议您确定天空盒图片路径是否正常,近地黑色是否是因为开启日照后,您查看地区属于夜晚的原因。

可以参考:

https://blog.csdn.net/supermapsupport/article/details/134790793
 

希望可以帮到您。
9,633EXP 2024年03月18日
...