THREE.Points and THREE.PointsMaterial
At the end of the previous section Understanding points, we briefly introduced THREE.Points
. The constructor of THREE.Points
takes two properties: a geometry and a material. The material is used to color and texture the particles (as we'll see later on), and the geometry defines where the individual particles are positioned. Each vertex and each point used to define the geometry is shown as an element on screen. When we create a THREE.Point
object based on THREE.BoxGeometry
, we get eight particles, one for each corner of the cube. Normally, though, you won't create a THREE.Points
object from one of the standard Three.js geometries, but add the vertices manually to a geometry created from scratch (or use an externally loaded model) just as we did at the end of the previous section, Understanding points. In this section, we'll dive a bit deeper into this approach and look at how you can use THREE.PointsMaterial
to style the individual elements. We'll explore...