我使用了THREE.js r49创建了2个立方体几何体和一个定向光源,在它们上投射阴影并获得结果,如下图所示.
我注意到绿色圆圈中的阴影不应该出现,因为方向光在两个立方体后面.我想这是材料问题,我尝试更改各种材料参数以及更改材料类型本身,但结果仍然相同.我还用r50和r51测试了相同的代码并得到了相同的结果.
有人可以给我一些提示如何摆脱那个阴影.
两个多维数据集都使用CubeGeometry和MeshLambertMaterial创建如下代码.

代码:
// ambient
var light = new THREE.AmbientLight( 0xcccccc );
scene.add( light );
// the large cube
var p_geometry = new THREE.CubeGeometry(10, 10, 10);
var p_material = new THREE.MeshLambertMaterial({ambient: 0x808080, color: 0xcccccc});
var p_mesh = new THREE.Mesh( p_geometry, p_material );
p_mesh.position.set(0, -5, 0);
p_mesh.castShadow = true;
p_mesh.receiveShadow = true;
scene.add(p_mesh);
// the small cube
var geometry = new THREE.CubeGeometry( 2, 2, 2 );
var material = new THREE.MeshLambertMaterial({ambient: 0x808080, color: Math.random() …Run Code Online (Sandbox Code Playgroud)