MCPcopy
hub / github.com/mrdoob/three.js

github.com/mrdoob/three.js @main sqlite

repository ↗ · DeepWiki ↗
15,330 symbols 46,492 edges 1,622 files 5,572 documented · 36%
README

three.js

NPM Package Build Size NPM Downloads jsDelivr Downloads Discord

JavaScript 3D library

The aim of the project is to create an easy-to-use, lightweight, cross-browser, general-purpose 3D library. The current builds only include WebGL and WebGPU renderers but SVG and CSS3D renderers are also available as addons.

ExamplesDocsManualWikiMigratingQuestionsForumDiscord

Usage

This code creates a scene, a camera, and a geometric cube, and it adds the cube to the scene. It then creates a WebGL renderer for the scene and camera, and it adds that viewport to the document.body element. Finally, it animates the cube within the scene for the camera.

import * as THREE from 'three';

const width = window.innerWidth, height = window.innerHeight;

// init

const camera = new THREE.PerspectiveCamera( 70, width / height, 0.01, 10 );
camera.position.z = 1;

const scene = new THREE.Scene();

const geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 );
const material = new THREE.MeshNormalMaterial();

const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );

const renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setSize( width, height );
renderer.setAnimationLoop( animate );
document.body.appendChild( renderer.domElement );

// animation

function animate( time ) {

    mesh.rotation.x = time / 2000;
    mesh.rotation.y = time / 1000;

    renderer.render( scene, camera );

}

If everything goes well, you should see this.

Cloning this repository

Cloning the repo with all its history results in a ~2 GB download. If you don't need the whole history you can use the depth parameter to significantly reduce download size.

git clone --depth=1 https://github.com/mrdoob/three.js.git

Change log

Releases

Core symbols most depended-on inside this repo

push
called by 2805
src/renderers/common/RenderList.js
add
called by 978
editor/js/libs/ui.js
add
called by 798
examples/jsm/inspector/ui/List.js
sub
called by 739
src/math/Color.js
oa
called by 728
examples/jsm/libs/draco/draco_decoder.js
set
called by 638
examples/jsm/math/Lut.js
apply
called by 637
examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.js
N
called by 570
examples/jsm/libs/draco/draco_wasm_wrapper.js

Shape

Method 7,962
Function 5,066
Class 2,302

Languages

TypeScript100%

Modules by API surface

examples/jsm/libs/draco/draco_decoder.js607 symbols
examples/jsm/libs/draco/gltf/draco_decoder.js519 symbols
editor/js/libs/codemirror/codemirror.js462 symbols
examples/jsm/libs/chevrotain.module.min.js202 symbols
examples/jsm/libs/basis/basis_transcoder.js189 symbols
examples/jsm/loaders/GLTFLoader.js174 symbols
examples/jsm/libs/ecsy.module.js152 symbols
src/nodes/core/NodeBuilder.js137 symbols
editor/js/libs/ui.js131 symbols
examples/jsm/loaders/FBXLoader.js130 symbols
examples/jsm/libs/fflate.module.js110 symbols
src/renderers/common/Renderer.js106 symbols

Dependencies from manifests, versioned

@eslint/js9.0.0 · 1×
@rollup/plugin-node-resolve16.0.0 · 1×
@rollup/plugin-terser1.0.0 · 1×
eslint9.0.0 · 1×
eslint-config-mdcs5.0.0 · 1×
eslint-plugin-html8.1.3 · 1×
eslint-plugin-jsdoc63.0.0 · 1×
globals17.0.0 · 1×
jpeg-js0.4.4 · 1×
jsdoc4.0.5 · 1×
magic-string0.30.0 · 1×

For agents

$ claude mcp add three.js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact