August 2018
Intermediate to advanced
528 pages
10h 58m
English
With this geometry, you can easily create polyhedrons. A polyhedron is a geometry that has only flat faces and straight edges. Most often, though, you won't use this geometry directly. Three.js provides a number of specific polyhedrons you can use directly without having to specify the vertices and the faces of THREE.PolyhedronGeometry. We'll discuss these polyhedrons later on in this section. If you do want to use THREE.PolyhedronGeometry directly, you have to specify the vertices and the faces (just as we did for the cube in Chapter 3, Working with the Different Light Sources Available in Three.js). For instance, we can create a simple tetrahedron (also see THREE.TetrahedronGeometry in this chapter) like this:
Read now
Unlock full access