threejs-interaction

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires three.

What problem does it solve? Building interactive 3D experiences 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 and Picking: Detect clicks, hovers, and touches on 3D objects using THREE.Raycaster with mouse/touch coordinate conversion and layer-based filtering. - Camera Controls: Configure OrbitControls, FlyControls, FirstPersonControls, PointerLockControls, TrackballControls, and MapControls with damping, limits, and auto-rotation. - Object Manipulation: Attach TransformControls gizmos, DragControls, and box selection for moving, rotating, and selecting scene objects. - Use Case: Build a product configurator where users orbit the camera around a 3D model, click parts to highlight them, and drag components into place. ## Quick Start Add click detection and orbit camera 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 (-1 to 1). Call intersectObjects on your clickable meshes and check the returned array for the closest intersected object.

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 controls.enableDamping = true and call controls.update() each frame for smooth movement.

Does Three.js raycasting work with touch input on mobile?

Yes, raycasting works with touch events by reading event.touches[0].clientX and clientY, then converting them to normalized device coordinates the same way as mouse input. Listen for touchstart on the renderer canvas and call preventDefault to avoid scrolling.

OrbitControls vs PointerLockControls, which should I use?

OrbitControls rotates the camera around a target point, suiting model viewers and scene inspection. PointerLockControls hides the cursor and rotates the camera freely, suiting first-person navigation where you move through the scene with keyboard input.

Why is my Three.js raycast slow on mousemove?

Raycasting every mousemove event against many objects is expensive. Throttle handlers to around 20fps, restrict intersection checks to specific clickable objects, use raycaster.layers for filtering, and substitute invisible simple geometry for complex meshes.