threejs-interaction

Implements raycasting, camera controls, and mouse/touch input handling for interactive Three.js scenes.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/ayofemiade/cleva --skill threejs-interaction-ayofemiade
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: threejs-interaction
Source: https://github.com/ayofemiade/cleva/tree/main/.claude/skills/threejs-interaction
Command: npx skills add https://github.com/ayofemiade/cleva --skill threejs-interaction-ayofemiade

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires three.

What problem does it solve? Building interactive 3D experiences in Three.js requires wiring together raycasting, camera controls, and input events, which involves repetitive boilerplate and subtle coordinate conversion math that is easy to get wrong. ## Core Features & Use Cases - Raycasting & Picking: Detect clicks, hovers, and touches on 3D objects with mouse-to-NDC coordinate conversion and intersection filtering. - Camera Controls: Configure OrbitControls, FlyControls, FirstPersonControls, PointerLockControls, TrackballControls, and MapControls with damping, limits, and auto-rotation. - Object Manipulation: Attach TransformControls gizmos and DragControls to move, rotate, and scale meshes, plus click and box selection systems. - Use Case: You are building a 3D product configurator where users click parts of a model to customize them. Use this Skill to set up raycast-based selection with hover highlighting and orbit camera navigation. ## Quick Start Add click detection and orbit controls to my Three.js scene so users can select and inspect 3D objects.

Frequently Asked Questions about threejs-interaction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect clicks on 3D objects in Three.js?▼

Use THREE.Raycaster with setFromCamera after converting mouse coordinates to normalized device coordinates. Call intersectObjects on your clickable meshes and read the first result's object, point, and distance properties.

How to add orbit camera controls in Three.js?▼

Import OrbitControls from three/addons/controls/OrbitControls.js and instantiate it with your camera and renderer.domElement. Enable damping with enableDamping and call controls.update() each animation frame for smooth movement.

OrbitControls vs PointerLockControls in Three.js?▼

OrbitControls rotates the camera around a target point, suiting model viewers and scene inspection. PointerLockControls locks the mouse for first-person navigation, suiting walkthroughs and games where WASD movement is needed.

Does Three.js raycasting work on touch devices?▼

Yes, raycasting works with touch events by reading event.touches[0] clientX and clientY, converting them to normalized device coordinates, and calling setFromCamera. Attach handlers to touchstart on the renderer canvas.

Why is Three.js raycasting slow on mousemove?▼

Raycasting every mousemove against the full scene is expensive. Throttle handlers to around 20fps, restrict intersection checks to specific clickable objects, use layers for filtering, and substitute simpler invisible collision meshes for complex geometry.