Graphics Reference
In-Depth Information
As you can see in this screenshot, we've loaded a cow geometry and created a point
cloud based on it. You can, of course, use any geometry you want, but especially
complex models look really great when rendered as a point cloud.
How to do it...
Creating a point cloud isn't that different from creating a simple
THREE.Mesh
object.
The following section explains the steps you should take:
1. The first thing you need in this approach is
THREE.Geometry
. You can use
either one of the standard geometries or load an external one. For this re-
cipe, we'll load an external one (the cow we mentioned in the
Getting ready
section of this recipe):
var loader = new THREE.OBJLoader();
loader.load(
"../assets/models/cow/cow.obj",
function(cow) {
// get the main cow geometry from
the
// loaded object hierarchy
var cowGeometry =
cow.children[1].geometry;
}
);