GitHub logo

Everything officially related to the three.js project is kept in one huge repository on Github. It’s maintained by the original creator of three.js, @mrdoob (AKA Ricardo Cabello), along with an army of open-source aficionados.

It’s a huge and active repo - the 7th most starred Javascript library on Github, and the 8th most forked. Its up there with superstars like React, jQuery, and Node.js.

There’s a lot to see here, but we only need to look inside a couple of folders for now. Go ahead and open the repo if you want to take a look now, but feel free to skip ahead and come back to this chapter later if you’re eager to get started.

The build/ Folder

Here are the three versions of the three.js core, one of which you need to include in your project:

We’ll cover the various ways of getting a hold of these files in Ch 0.6: How to Include three.js in Your Projects.

The examples/ Folder

The main thing that this folder holds is source code for the official examples, and there are a lot of useful goodies contained here too, such as:

You can view live versions of the examples here. You should definitely make sure that you are familiar with these and whenever you are working to understand a new feature of three.js, check the examples to see if there is one that covers it and go over the corresponding source code.

Nearly everything in this folder is covered by the same MIT license as three.js, which means that you are free to use anything in your own projects, in any way that you like.

The src/ Folder

The uncompiled three.js source files are all contained here, in the src/ folder. While you are learning to use three.js you won’t need to look in here that often, but as you become more proficient you’ll probably need to know how the actual three.js code is implemented. To make things easier, every docs page has a direct link to the relevant file in the src/ folder.

Other Folders

There are a couple of other folders in addition to the ones mentioned above. We won’t be covering them further in this book, but you may find their contents useful: