# three.js examples — card for AI agents

Hundreds of official three.js WebGL/WebGPU examples (shaders, particles, post-processing, loaders) with full source in the repo's examples folder.

Category: Web animation examples and effects (also: Video references and motion backgrounds, 3D models) · maker three.js authors (mrdoob) · checked 2026-11-05 · style: 3d, abstract, dark

## Price
- Price: Free
- Free tier: Fully free.

## License
MIT — https://raw.githubusercontent.com/mrdoob/three.js/dev/LICENSE

- commercial: **yes** (Commercial use OK)
  > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  (https://raw.githubusercontent.com/mrdoob/three.js/dev/LICENSE)
- attribution: **no** (No credit needed)
  > The above copyright notice and this permission notice shall be included in all
  (https://raw.githubusercontent.com/mrdoob/three.js/dev/LICENSE)
- in app: **yes** (Can ship inside your app)
  > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  (https://raw.githubusercontent.com/mrdoob/three.js/dev/LICENSE)
- redistribute: **yes** (Can pass the files on to your own users)
  > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  (https://raw.githubusercontent.com/mrdoob/three.js/dev/LICENSE)

## Rules to follow
- Keep the MIT notice if you redistribute the code.
- Models, textures and sounds used by examples are separate files; do not assume they share the code's MIT license.

## Can an AI agent use it by itself?
**Yes** · copy-code: Agent copies the code, snippet or prompt from the page (no account)

## How an agent gets files
- Open an example, then copy its HTML/JS from github.com/mrdoob/three.js/tree/dev/examples; npm install three. (sign-in: none)
- Formats: html, js
- Not allowed: Example assets may have their own licenses

## How to connect
- Package (npm/PyPI)
- npm: `npm install three`
- Repository: https://github.com/mrdoob/three.js
- Website: https://threejs.org/examples/

## Notes
Pin the three version (npm latest 0.187.0) — examples track the dev branch.

## Numbers (AgentGid data)
- Gid Score: 82
- GitHub stars: 118,722
- Downloads last week: 36,636,204
- Used in 144 public projects set up for AI coding agents

## Lines to paste into your prompt or AGENTS.md

```
- three.js examples (Web animation examples and effects, Video references and motion backgrounds, 3D models). Hundreds of official three.js WebGL/WebGPU examples (shaders, particles, post-processing, loaders) with full source in the repo's examples folder. Price: free; commercial use OK; no credit needed. Style: 3d, abstract, dark.
  Connect: npm three.
  Get files: Open an example, then copy its HTML/JS from github.com/mrdoob/three.js/tree/dev/examples; npm install three (html, js).
  Not allowed: Example assets may have their own licenses
  Rule: Keep the MIT notice if you redistribute the code.
  Rule: Models, textures and sounds used by examples are separate files; do not assume they share the code's MIT license.
  License: https://raw.githubusercontent.com/mrdoob/three.js/dev/LICENSE (checked 2026-11-05; details: https://agentgid.com/assets/threejs-examples/)
```

## Links
- AgentGid page: https://agentgid.com/assets/threejs-examples/
- Is it free for commercial use? https://agentgid.com/assets/threejs-examples/commercial-use/
- Source: https://threejs.org/examples/
- Source: https://raw.githubusercontent.com/mrdoob/three.js/dev/LICENSE
- Source: https://registry.npmjs.org/three/latest


## three.js examples: working 3D scenes to copy

three.js is a free code library that draws 3D scenes in a web page, and its site has hundreds of small working examples, from particle waves to 3D models. You or your AI assistant open one, see its full code and copy the parts you need into your own site. The code is free for paid projects; some example models and pictures have their own licenses.

### Where to use it
- Moving background for a landing page: Put a slowly moving 3D scene, like a wave of dots, behind the headline of your home page. The text stays on top and clickable.
- A 3D model of your product: Show a product, a building or a character as a 3D model that loads on the page. The docs advise the glTF file format, which many 3D apps can export.
- Let visitors turn and zoom the model: Add mouse and touch controls so people can spin a model around and zoom in. Controls, loaders and effects come with three.js and only need to be imported.
- Start from an example that already works: Find an effect close to what you want in the examples gallery, open its code, and change colors, shapes and speed. This is faster than starting from an empty page.
- Many objects in one scene: Draw hundreds of bars, trees or seats at once, for example a 3D chart or a seating map, without slowing the page down. (idea, not from the official pages)

### How to start
- Install three.js and the Vite build tool in your project folder.

```
# three.js
npm install --save three
# vite
npm install --save-dev vite
```

- Make the three basic parts of every scene: a scene, a camera and a renderer that draws the picture.

```
import * as THREE from 'three';
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
const renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
```

- Open an example at threejs.org/examples, use its View source link, and copy the parts you need at the same three.js version.

### License
The three.js code is free for personal and paid projects under the MIT license, with no visible credit needed. Keep its short license notice in copies of the code. Models, pictures and sounds used by the examples are not all free; check each one.

### Good to know
- Some 3D models in the examples are for non-paying projects only, such as the helmet model. Use your own models or free ones in paid work.
- Pages with three.js need a small local web server while you build them; opening the file by double-click breaks some features.
- Memory used by shapes, materials and pictures is not freed by itself. Pages that add and remove scenes must free it in code, or they get slower.
- Load all three.js files from one version and one place. If you load them from an outside server and it goes down, your page stops working too.
- Downloading the whole project with all its history is about 2 GB. To copy one example, open its code page instead.

Checked 2026-11-09 against: https://threejs.org/, https://threejs.org/examples/, https://threejs.org/examples/files.json, https://threejs.org/examples/webgl_points_waves.html, https://threejs.org/examples/webgl_loader_gltf.html, https://threejs.org/docs/, https://threejs.org/manual/, https://threejs.org/manual/list.json, https://threejs.org/manual/pages/installation.html, https://threejs.org/manual/pages/creating-a-scene.html, https://threejs.org/manual/pages/loading-3d-models.html, https://threejs.org/manual/pages/how-to-dispose-of-objects.html, https://threejs.org/manual/pages/tips.html, https://threejs.org/manual/pages/webgpurenderer.html, https://threejs.org/manual/pages/faq.html, https://threejs.org/manual/pages/rendering-on-demand.html, https://threejs.org/manual/pages/libraries-and-plugins.html, https://github.com/mrdoob/three.js/blob/dev/README.md, https://github.com/mrdoob/three.js/blob/dev/LICENSE, https://github.com/mrdoob/three.js/blob/dev/examples/models/gltf/DamagedHelmet/README.md, https://registry.npmjs.org/three/latest

### Mistakes to avoid
- Don't: Load three from one version or CDN and the addons (OrbitControls, GLTFLoader) from another → Do: Pin one version for everything, e.g. "three": ".../three@0.187.0/build/three.module.js" and "three/addons/": ".../three@0.187.0/examples/jsm/" (Mixed versions or sources can load duplicate code or break the page.)
- Don't: Open index.html by double-click (file://) to test the scene → Do: Run a local server, e.g. npx vite or npx serve ., and open the localhost address (Module imports and loading models or textures do not work from a double-clicked file.)
- Don't: scene.remove(mesh) and expect the memory to be freed → Do: Also call mesh.geometry.dispose(), mesh.material.dispose() and texture.dispose() for each texture you no longer use (three.js does not free graphics memory by itself.)
- Don't: import * as THREE from 'three' and then new THREE.WebGPURenderer() → Do: import * as THREE from 'three/webgpu' for the WebGPU renderer (The WebGPU renderer lives in a different build file.)
- Don't: Ship a model or texture copied from the examples folder in a paid product → Do: Check the license note next to each example file, or use your own or CC0 models (Example assets are not all under MIT; some are non-commercial.)

### Questions
- Can I use code from the three.js examples in a paid product? Yes. The code is under the MIT license, which allows use and sale of copies; keep the license notice in copies of the code.
- Can I also use the 3D models from the examples? Not always. Each model has its own license, and some, like the damaged helmet, are for non-commercial use only.
- Which 3D file format should I use? glTF (.glb or .gltf), which the docs recommend where possible.
- Does it work on devices without the newest graphics support? The newer WebGPU renderer falls back to WebGL 2 when a device or browser has no WebGPU; the classic WebGL renderer is also available.
- Can the 3D scene sit behind my page text? Yes. The docs show a canvas fixed behind the content or an iframe as the page background.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
