Three.js Examples (r171, revised by SHK)

The goal of this collection is to provide a set of basic and instructive examples that introduce the various features in Three.js. The source code for each page contains detailed comments.
Hosted at GitHub. Total examples: 83. Last updated: 23 August 2013. Compatible with Three.js version 60.
Last updated: December 2024. Compatible with Three.js version 171.


Basic Examples
Info Box
Camera/Renderer Examples
Red/Blue Anaglyph
Video/Webcam Examples
Video to Texture Many Cameras Sphere Projection



Info Box

The template code with minimal jQuery added to create a button that displays an information dialog box.


Anaglyph

Displays a scene rendered using an Anaglyph effect; use red/blue 3D glasses to view.


Video to Texture

Display a video as a texture. Keyboard controls: "P" to play/resume, "SPACE" to pause, "R" to rewind, "S" to stop.


Many Cameras

Displays user webcam image as a texture on a moveable mesh (W/A/S/D/Q/E). Incorporates code from examples: Webcam Texture, Mesh Movement, Reflection, Skybox, and Viewports - Dual. Requires Webcam, user needs to accept permissions to run, requires WebRTC compatible browser (see http://www.webrtc.org/).


Sphere Projection

Projects a wireframe cube onto a sphere. Includes a method for drawing the arc between two points on a sphere.