Graphics Reference
In-Depth Information
Creating
a
point
cloud
based
on
a
geometry
An interesting feature of Three.js is that it also allows you to create point clouds.
A point cloud isn't rendered as a solid geometry, but all the individual vertices are
rendered as single points. In this recipe, we'll show you how to create such a point
cloud based on an already existing geometry.
Getting ready
There are no additional steps required to start with this recipe. For the example we
use in this recipe, however, we use an external model as the basis for our point cloud.
We also use a camera control object, THREE.OrbitControls , to make navigation
around the example easier. If you want to use the camera control object yourself,
you need to add the following JavaScript libraries to the scene (besides the standard
Three.js one):
<script src="../libs/
OrbitControls.js"></script>
<script src="../libs/OBJLoader.js"></script>
The external model we use is also provided with the sources in this topic and can
be found in the assets/models/cow folder. To see what the result of this recipe
can look like, we provided an example that shows you a point cloud that was cre-
ated based on an existing geometry ( 06.01-create-point-cloud-from-geo-
metry.html ).You will see something similar to the following screenshot:
Search WWH ::




Custom Search