admin管理员组

文章数量:1341751

i have a problem. i have wrote some code on three.js, it consists of scene, 2 objects, renderer and camera. but when i added the light i didnt see the it! i tried some options..but nothing helped me my code there -

var light = new THREE.SpotLight(0xff0000);
light.position.set( 0, 0, 50 );

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

scene.add(light);
scene.add(pointLight);

//code
renderer.render(scene, camera);

i dont know, what caused that problem :(

i have a problem. i have wrote some code on three.js, it consists of scene, 2 objects, renderer and camera. but when i added the light i didnt see the it! i tried some options..but nothing helped me my code there - http://codepen.io/usf/pen/LaDwh

var light = new THREE.SpotLight(0xff0000);
light.position.set( 0, 0, 50 );

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

scene.add(light);
scene.add(pointLight);

//code
renderer.render(scene, camera);

i dont know, what caused that problem :(

Share Improve this question asked May 10, 2013 at 20:49 user1128677user1128677 4792 gold badges11 silver badges19 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 16

MeshBasicMaterial does not respond to lights. Change your material to MeshPhongMaterial, for example.

本文标签: javascripthave no light on my threejs sceneStack Overflow