我遇到的问题是在Object3D组的脸上没有收到阴影。
阴影是从物体投射出来并被地面接收的,但是阴影在它们应该的时候不会被彼此接收。
我已经四处寻找,但我似乎无法找到类似的问题,这让我相信我设置错误。
有人能看一眼吗?我在下面的JSfiddle中放了一个工作示例。我认为这可能与我设置面孔的方式有关。
https://jsfiddle.net/shanemccster/848k1qxh/
var makeobject = function(width, height, depth){
logger('makeobject fired');
var geometry = new THREE.BoxGeometry( width, height, depth );
var materials = [
new THREE.MeshLambertMaterial({ color: 0xffffff }),
new THREE.MeshLambertMaterial({ color: 0xffcc00 }),
new THREE.MeshLambertMaterial({ color: 0xffffff }),
new THREE.MeshLambertMaterial({ color: 0xffcc00 }),
new THREE.MeshLambertMaterial({ color: 0xffffff }),
new THREE.MeshLambertMaterial({ color: 0xffcc00 })
];
var texture = new THREE.MeshFaceMaterial( materials );
texture.minFilter = THREE.LinearFilter;
var theObject = new THREE.Mesh(geometry,texture);
theObject.recieveShadow = true;
theObject.castShadow = true;
return theObject;
}