THREE.JS阴影未投射-聚光灯

时间:2018-08-07 12:56:24

标签: three.js

使用THREE.JS,我当前正在使用SpotLight。 我有一个MeshLambertMaterial(4个女孩),应该为(Mansion)后面的图片蒙上阴影,但不确定为什么不是。

a busy cat

到目前为止,我的代码备受关注

let spotLight = new THREE.SpotLight( 0xFFFFFF, 1);
spotLight.castShadow = true;
spotLight.position.set( 10, 5, 100 );
spotLight.target.position.set(0, 5, 0);
spotLight.shadowCameraNear = 20;
spotLight.shadowCameraFov = 30;
spotLight.shadowBias = 0.0001;
spotLight.shadowCameraVisible = true;

scene.add( spotLight );

1 个答案:

答案 0 :(得分:2)

在“ 4个女孩”对象上,设置.castShadow = true;然后在您的豪宅图片上设置.receiveShadow = true;