Summary
In this chapter, we explored how you can extend the basic 3D functionality of Three.js by adding physics. For this, we used the Rapier library, which allows you to add gravity to your scene and objects, have objects interact with each other and bounce when they collide, and use joints to limit the movement of objects relative to each other.
Besides that, we also showed you how Three.js supports 3D sounds. We created a scene where you added positional sound using the THREE.PositionalAudio
and THREE.AudioListener
objects.
Even though we’ve now covered all of the core functionalities provided by Three.js, there are two more chapters dedicated to exploring some external tools and libraries that you can use together with Three.js. In the next chapter, we’ll dive into Blender and see how we can use Blender’s functionality, such as baking shadows, editing UV maps, and exchanging models between Blender and Three.js.