There is no light on my scene three.js

I have a problem. I wrote code for three. js, it consists of a scene, 2 objects, a renderer and a camera. but when I added the light, I did not see it! I tried some options ... but nothing helped me with 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 do not know what caused this problem :(

+4
source share
1 answer

MeshBasicMaterial does not respond to indicators. For example, replace your material with MeshPhongMaterial .

+11
source

Source: https://habr.com/ru/post/1480170/


All Articles