2015-04-02 87 views
0

編輯: 現在我已經使用第一MeshBasicMaterial和第二MeshLambertMaterial 2點準系統的例子:點光源不亮什麼

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已正確應用於現場?

+0

看看我編輯的答案。 – gaitat 2015-04-08 22:29:11

回答

3

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); 
+0

你可以創建一個jsfiddle嗎?你的光線在負x軸上。你網眼的那一面更明亮嗎? – gaitat 2015-04-02 19:33:58

+0

謝謝:D 11小時過後,我可以給你賞金 – loldrup 2015-04-09 09:47:52

1

MeshBasicMaterial不受光線,用其他材料按照gaitat的建議鍵入。

在我身上發生的事情經常是光線太小而不易察覺,或者它離我想照亮的網格太遠。也許這也是你的情況。