首页 / 浏览问题 / 三维GIS / 问题详情
iclient加载3dtiles模型,阴影分析正常,日照分析黑闪一下就没效果了。但是s3m模型日照分析正常
26EXP 2024年07月12日
iclient加载3dtiles模型,阴影分析正常,日照分析黑闪一下就没效果了。但是s3m模型日照分析正常

1个回答

您用的是cesium还是webgl呢?您的代码是怎么写的呢?可以提供下代码吗
1,180EXP 2024年07月12日

使用的是:icliend 3d for cesium

加载3dtiles的代码:

let tdtiles = new Cesium.Cesium3DTileset({
      url: layerInfo.url,
      shadows: Cesium.ShadowMode.ENABLED,
      cullWithChildrenBounds: true,
      dynamicScreenSpaceError: true,
      maximumScreenSpaceError: 2,        //最大的屏幕空间误差
      maximumMemoryUsage: 8192,
      luminanceAtZenith: 0.6
    })
    var tileset = this.viewer.scene.primitives.add(
      tdtiles
    );

日照效果代码:

const that = this
    that.viewer.shadows = true;
    that.viewer.shadowMap.darkness = 0.3;
    that.viewer.terrainShadows = Cesium.ShadowMode.RECEIVE_ONLY
    // 01设置环境光的强度-新处理CBD场景
    that.viewer.scene.lightSource.ambientLightColor = new Cesium.Color(0.65, 0.65, 0.65, 1);
    var startTime = new Date(date);
    var shour = Number(startour);
    var ehour = Number(endour);
    if(shour > ehour) {
        return;
    }
    var nTimer = 0.0;
    if(that.nIntervId == null){
      that.nIntervId = setInterval(function() {
          if(shour < ehour) {
              startTime.setHours(shour);
              startTime.setMinutes(nTimer);
              that.viewer.clock.currentTime = Cesium.JulianDate.fromDate(startTime);
              nTimer += 10.0;
              if(nTimer > 60.0){
                  shour += 1.0;
                  nTimer = 0.0;
              }
          }else {
              clearInterval(that.nIntervId);
              that.nIntervId = null
          }
      }, that.playStep);
    }

日照分析仅支持三维服务的S3M图层,你可以试下将3dtiles发布为超图的服务,看是否能够正常
...