Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Three.js 使用网格Lambert材质时,灯光效果看起来很奇怪_Three.js - Fatal编程技术网

Three.js 使用网格Lambert材质时,灯光效果看起来很奇怪

Three.js 使用网格Lambert材质时,灯光效果看起来很奇怪,three.js,Three.js,我在将Mesh Lambert Material与Three.js一起使用时遇到问题,我有一个具有不同高度点的平面,但是当尝试应用灯光时,较高的点看起来更暗,应该是相反的,我的代码如下所示: var geometry = new THREE.PlaneBufferGeometry(7500, 7500, worldWidth - 1, worldDepth -1); geometry.computeFaceNormals(); geometry.applyMatrix(new THREE.Mat

我在将Mesh Lambert Material与Three.js一起使用时遇到问题,我有一个具有不同高度点的平面,但是当尝试应用灯光时,较高的点看起来更暗,应该是相反的,我的代码如下所示:

var geometry = new THREE.PlaneBufferGeometry(7500, 7500, worldWidth - 1, worldDepth -1);
geometry.computeFaceNormals();
geometry.applyMatrix(new THREE.Matrix4().makeRotationX(- Math.PI / 2));

texture = THREE.ImageUtils.loadTexture('img/grass.png');
mesh = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial({ map: texture }));
scene.add(mesh);

var pointLight = new THREE.PointLight(0xffffff, 100, 0);
pointLight.position.set(5, 50, 5);
scene.add(pointLight);
结果如下所示:

var geometry = new THREE.PlaneBufferGeometry(7500, 7500, worldWidth - 1, worldDepth -1);
geometry.computeFaceNormals();
geometry.applyMatrix(new THREE.Matrix4().makeRotationX(- Math.PI / 2));

texture = THREE.ImageUtils.loadTexture('img/grass.png');
mesh = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial({ map: texture }));
scene.add(mesh);

var pointLight = new THREE.PointLight(0xffffff, 100, 0);
pointLight.position.set(5, 50, 5);
scene.add(pointLight);

提前非常感谢。

在您给

THREE.PointLight(0xffffff, 100, 0);

当“法线范围”为0.0-1.0时,将“强度”指定为100,这样场景就会过亮

你试过改变灯光的位置吗?我已经试过降低亮度,但是场景完全变暗了。你确定灯光不在表面的另一侧吗?