Testing and Experimenting with the Examples
Build and run the first Three.js example.
We'll cover the following...
Install the dependencies
First, we need to download the external libraries. For instance, Three.js is one of the dependencies we need to download.
We need two types of dependencies, one for runtime and the other for development. In the dependencies section (lines 8–19), we have the library three (line 13). This is the primary library for 3D graphics. We also need a build tool to bundle and optimize our projects. In the devDependencies section (lines 20–24), we will use webpack (line 23) for this purpose.
To download all the dependencies, we run the following command:
The preceding command will start downloading all the required JavaScript libraries and store these in the node_modules folder.
Next, we need to build the examples. Doing so will combine our source code and the external libraries into a single file, which we can show ...