For projects without a bundler, use an importmap to map the module names to CDN URLs:
: If you prefer not to download files, you can link directly to a CDN like jsDelivr or unpkg. Always ensure the version of the addon matches your core Three.js version to avoid errors. Core Implementation Methods 1. Modern Module Import (Standard) download orbitcontrols.js
Orbit Controls - Install with cdn - Questions - three.js forum For projects without a bundler, use an importmap
import * as THREE from 'three'; import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; const controls = new OrbitControls(camera, renderer.domElement); Use code with caution. 2. Import Maps (No Bundler) Modern Module Import (Standard) Orbit Controls - Install
: For professional development with bundlers like Vite or Webpack, install the core Three.js package. OrbitControls is included in the three package under the examples folder. npm install three Use code with caution.
OrbitControls.js is an essential addon for Three.js that allows users to rotate, pan, and zoom around a 3D scene using a mouse or touch gestures. Because it is an addon, it is not included in the core Three.js library and must be downloaded or imported separately. How to Download OrbitControls.js
If you are using a build tool or , use the standard addon path: javascript