threejs-interaction
Installation
SKILL.md
Three.js Interaction
Work Pattern
- Convert pointer coordinates relative to the renderer canvas, not always the full window, unless the canvas truly fills the viewport.
- Keep controls updated in the animation loop when damping or time-based movement is enabled.
- Separate hover, selection, drag, transform, and keyboard state so tool modes do not fight each other.
- Pair with
threejs-fundamentalsfor camera/canvas setup,threejs-animationfor state feedback, andthreejs-postprocessingfor outlines or selection highlights.
Quick Start
import * as THREE from "three";
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
// Camera controls
const controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;