In this section, we'll look at a different way of creating geometries. In this chapter so far, and in the previous Chapter 5, Learning to Work with Geometries, we used the default geometries provided by Three.js to create interesting-looking geometries. With the default set of properties, you can create beautiful models, but you are limited to what Three.js provides. In this section, we'll show you how you can combine these standard geometries to create new ones-a technique known as Constructive Solid Geometry (CSG). To do this, we use the Three.js extension ThreeBSP, which you can find online at https://github.com/skalnik/ThreeBSP. This additional library provides the following three functions:
Name |
Description |
intersect |
This function allows you to create a new geometry based on the... |