Hi all
i’m a newbie with three js
i’m tring to illuminate this object with two directionallight but i get light only on the back… what do i miss?? can be an object “bug” ?
light2 is the one with problems
function createDirectionalLightWithHelper(x, y, z,tx,ty,tz,color,intensity) {
var light = new THREE.DirectionalLight(color, intensity);
light.position.set(x, y, z);
light.castShadow = true;
light.target.position.set(tx, ty, tz);
light.target.updateMatrixWorld();
light.shadow.mapSize.width = 1024;
light.shadow.mapSize.height = 1024;
light.shadow.camera.near = 0.5;
light.shadow.camera.far = 50;
var helper = new THREE.DirectionalLightHelper(light, 5);
scene.add(helper);
helper.parent.updateMatrixWorld();
helper.update();
var shadowHelper = new THREE.CameraHelper(light.shadow.camera);
scene.add(shadowHelper);
return light;
}
var light1 = createDirectionalLightWithHelper(0, 20, -50,0,50,0,0xffffff,3);
var light2 = createDirectionalLightWithHelper(0, 20, 50,0,50,0,0xffffff,3);
scene.add(light1);
scene.add(light2);