Adding a moving all-directional light

In a lot of cases, you don't need a light source that casts shadows but just a light source that illuminates your scene. In the Creating shadows with THREE.SpotLight and Creating shadows with THREE.DirectionalLight recipes, we already showed you how you can use THREE.SpotLight and THREE.DirectionalLight. In this recipe, we'll show you a third kind of light, which is THREE.PointLight; this kind of light emits light to all directions and in this recipe, we will show you how to create one and move it through the scene.

Getting ready

As the Three.js standard comes with the THREE.PointLight object, there is no need to include any additional JavaScript. The same is the case with all the recipes where we've included ...

Get Three.js Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.