Coloring the individual points in a point cloud

When you create a point cloud, every point has the same color and style, as every point uses the same THREE.PointCloudMaterial object. There is, however, a way to add color to the individual points.

Getting ready

There is no need for any additional steps to run this recipe. We'll create a custom geometry, just like we did in the Creating a point cloud from scratch recipe, and this time, we color each individual point. The result of this recipe can be seen by opening 06.03-color-individual-points-in-point-system.html in your browser. You will see something similar to the following screenshot:

Getting ready

As you can ...

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.