Creating a scene
The goal of this section is to give a brief introduction to Three.js. We will start by setting up a scene, with a spinning cube. A working example is provided at the bottom of the page in case you get stuck and need help.
What is Three.js?
Let's try to describe it briefly:
Three.js is a library that makes WebGL - 3D in the browser - easy to use. While a simple cube in raw WebGL would turn out hundreds of lines of Javascript and shader code, a Three.js equivalent is only a fraction of that.
Before we start
Before you can use Three.js, you need somewhere to display it. Save the following HTML to a file on your computer, along with a copy of three.min.js in the js/ directory, and open it in your browser.