Glossary · 3D on the web

three.js

In short

three.js is an open-source JavaScript library for 3D graphics in the browser. It handles the scene, camera, lighting, materials and model loading, and renders through WebGL or WebGPU [1].

What three.js handles

In its own words, the project aims to create an easy-to-use, lightweight, cross-browser, general-purpose 3D library [1]. Instead of writing buffers and shaders by hand, developers work with objects:

  • Scene and scene graph: objects with parents and children.
  • Cameras and controls, such as orbit controls.
  • Materials, up to physically based ones with clearcoat, glass or fabric.
  • Loaders for formats such as glTF/GLB, including Meshopt and Draco compression [2].
  • Renderers for WebGL and WebGPU [1][3].

Licence and versions

three.js is released under the MIT licence [1], so it can be used in commercial projects. The library ships in numbered releases (r…) whose interfaces can change, so projects should pin the version and test before updating.

three.js or a ready-made component?

three.jsReady-made component (e.g. model-viewer)
Freedomfull control over scene, rules and presentationlimited to built-in features
Effortprogramming requiredone HTML element
Suitsconfigurators with logic, variants, exploded viewssimple product view, AR

From our library

Every example configurator in our library is built with three.js, from the spiral stair configurator with parametric geometry to the planetary gearhead with a loaded GLB (fictional products). The renderer reports diagnostics such as draw calls per frame directly [4].

The pillar page 3D configurator explains how we build configurators on this basis.

Related terms

  • WebGL

    WebGL (Web Graphics Library) is a JavaScript API that lets web pages draw hardware-accelerated 2D and 3D graphics in the browser without plug-ins. It renders into an HTML canvas element using the device's graphics hardware.

  • WebGPU

    WebGPU is a browser interface that lets web pages use the graphics card for rendering and general computation. It is regarded as the successor to WebGL and gives access to more modern GPU features.

  • Babylon.js

    Babylon.js is an open game and rendering engine packaged as a JavaScript framework, with TypeScript typings and WebGL and WebGPU support, under the Apache 2.0 licence. Like three.js it loads glTF and suits product configurators.

  • model-viewer

    model-viewer is an open-source web component from Google that embeds interactive 3D models and AR views in a page through a single HTML element.

  • glTF

    glTF (GL Transmission Format) is a royalty-free Khronos Group specification for the efficient transmission and loading of 3D scenes and models. In 2022 glTF 2.0 became the international standard ISO/IEC 12113:2022.

  • 3D configurator

    A 3D configurator is a product configurator that shows every choice immediately on a 3D model the buyer can turn in the browser. Visual feedback is described as a core feature of configuration systems. More: [3D configurator](/en/3d-configurator/)

Examples to try

Example configurator · fictional product

Spiral stair configurator

Plan a spiral stair: enter floor height and opening, treads and rotation are calculated, choose diameter, direction, railing and materials – with an example check and a PDF enquiry.

Stairs & access · Dimensions and sizes · Materials and finishes · Options, modules and accessories

Example configurator · fictional product

Planetary gearhead

A planetary gearhead for sales and training: running drive with adjustable input speed, cut-away and exploded views, item numbers and technical data as sample values.

Industrial cells & machines · Opening and mechanism · Exploded or cut-away view · Notes on the model

Sources

  1. three.js on GitHub (README and licence)
  2. three.js docs: GLTFLoader
  3. three.js docs: WebGPURenderer
  4. three.js docs: WebGLRenderer

← All terms in the glossary