#
luxiaotao1123
2024-03-28 6ff56fd8c087623fa96354610536210a1cd5b539
#
1个文件已修改
15 ■■■■■ 已修改文件
zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
@@ -23,7 +23,7 @@
        this.stats = this.initStats(container);
        this.windowResize();
        this.initRaycaster(container);
        // initLight(this.scene);
        initLight(this.scene);
        this.objects = [];
    }
@@ -64,7 +64,7 @@
    }
    initCamera = () => {
        const camera = new THREE.PerspectiveCamera(70, this.fullWidth / this.fullHeight, 1, 10000);
        const camera = new THREE.PerspectiveCamera(70, this.fullWidth / this.fullHeight, 1, 60000);
        camera.position.set(debugCamera.x, debugCamera.y, debugCamera.z);
        this.scene.add(camera);
        return camera;
@@ -178,13 +178,16 @@
    scene.add(ambientLight);
    const spotLight = new THREE.SpotLight(0xffffff, 8);
    spotLight.position.set(0, 300, 0);
    spotLight.angle = Math.PI * 1;
    spotLight.decay = 0;
    spotLight.position.set(0, 1000, 0);
    spotLight.angle = Math.PI / 4;  // 角度
    spotLight.distance = 1500;  // 距离
    spotLight.decay = 0;    // 光衰
    // 光照阴影及其生效范围
    spotLight.castShadow = true;
    spotLight.shadow.camera.near = 200;
    spotLight.shadow.camera.near = 50;
    spotLight.shadow.camera.far = 2000;
    spotLight.shadow.bias = - 0.000222;
    // 阴影特效高低值
    spotLight.shadow.mapSize.width = 1024;
    spotLight.shadow.mapSize.height = 1024;
    scene.add(spotLight);