PointLight 不会照亮任何东西

PointLight won't illuminate anything

编辑: 现在我有两个使用第一个 MeshBasicMaterial 和第二个 MeshLambertMaterial 的准系统示例:

PointLight_sucks__MeshBasicMaterial.html

PointLight_sucks__MeshLambertMaterial.html

两者都使用了 PointLight,但 LambertMaterial 几何体并没有被照亮(但屏幕上似乎有闪烁的小点?)。


我有一个用 MeshBasicMaterial 制作的几何图形。它以某种方式照亮了自己:

我也有一个PointLight:

light = new THREE.PointLight( 0xaaaaaa );
light.position.set = new THREE.Vector3(-400, 0, 0);
makeScene.scene.add( light );

但是对场景没有影响。我希望场景仅由 PointLight.

照亮

我为我的几何体尝试了各种其他材料,例如 MeshPhongMaterial、MeshNormalMaterial、MeshLambertMaterial 和 MeshFaceMaterial。

我就是这样应用 MeshBasicMaterial:

material = new THREE.MeshBasicMaterial( { map: texture } );
mesh = new THREE.Mesh(aGeometry, material);

我怀疑我的 PointLight 可能有问题。如何验证 PointLight 是否正确应用于场景?

THREE.MeshBasicMaterial()不受光线影响。将其更改为 THREE.MeshLambertMaterial()THREE.MeshPhongMaterial()

编辑:

此外 THREE.PointLight() 不影响 THREE.MeshBasicMaterial() 根据 http://threejs.org/docs/#Reference/Lights/PointLight

根据 PointLight() 和与 MeshLambertMaterial() 的交互,您的代码中有一个错误: 行数

light1.position.set = new THREE.Vector3(0, -120, 150);
light2.position.set = new THREE.Vector3(0,  120, 150);

应该是

light1.position.set (0, -120, 150);
light2.position.set (0,  120, 150);

MeshBasicMaterial 不受光线影响,请使用 gaitat 建议的其他 material 类型。

我经常遇到这样的情况,即光线太小而不明显,或者光线离我要照亮的网格太远。也许这也是你的情况。