threejs-interaction

Implement raycasting, camera controls, and drag interactions in Three.js scenes.

1|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/shige1014-dev/backup-OpenMontage --skill threejs-interaction-shige1014-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-interaction
Source: https://github.com/shige1014-dev/backup-OpenMontage/tree/main/.agents/skills/threejs-interaction
Command: npx skills add https://github.com/shige1014-dev/backup-OpenMontage --skill threejs-interaction-shige1014-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Handling user input, selection, and camera control in Three.js scenes is error-prone and repetitive; this Skill centralizes best practices for raycasting, mouse/touch conversion, and control integration so interactive 3D experiences behave reliably across devices.

Core Features & Use Cases

  • Raycasting & Picking: Precise mouse and touch-to-world conversions, intersect object detection, and UV/face information retrieval for click and hover interactions.
  • Camera Controls: Integration examples for OrbitControls, PointerLockControls, FlyControls, TrackballControls, and MapControls with damping, limits, and update patterns.
  • Selection & Manipulation: Click-to-select, box selection, transform gizmos, drag controls, hover feedback, and selection helpers for editor-style workflows.
  • Input Coverage & Performance: Touch support, keyboard movement, world↔screen conversions, ray-plane intersections, throttling recommendations, layer filtering, and collision proxy meshes for efficient raycasting.
  • Use Case: Building an interactive product configurator where users click parts to inspect or drag components, with orbit camera controls and touch-friendly selection on mobile.

Quick Start

Use the threejs-interaction skill to add raycast-based click selection, orbit controls with damping, and basic touch support to your scene.

Frequently Asked Questions about threejs-interaction

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

FAQPage Schema
How do I handle mouse and touch picking in Three.js scenes?

Mouse and touch picking in Three.js uses raycasting with normalized device coordinate conversion to detect intersections. This approach maps screen clicks to 3D world coordinates, retrieving the intersected object, face, and UV information for reliable click and hover interactions across devices.

How do I set up OrbitControls with damping and touch support in Three.js?

OrbitControls in Three.js integrate damping, limits, and update patterns for smooth camera movement. Touch fallback ensures mobile compatibility, while update loops maintain responsive rotation, zoom, and panning for interactive 3D applications.

What is the best way to implement click-to-select and drag interactions in Three.js?

Click-to-select and drag interactions in Three.js combine raycasting for object detection with transform gizmos and drag controls. This enables editor-style workflows where users click parts to inspect, use box selection, and drag components with hover feedback.

How can I optimize raycasting performance for complex Three.js scenes?

Optimize raycasting in Three.js by throttling input events, filtering object layers to reduce intersection tests, and using collision proxy meshes. These practices minimize computational overhead when checking for object intersections during interactions.

Does Three.js support keyboard movement and camera controls like PointerLock and FlyControls?

Three.js supports PointerLockControls, FlyControls, TrackballControls, and MapControls for camera movement. These integrate with keyboard input for first-person navigation, providing damping and update patterns for interactive browser-based 3D applications.

How do I convert between screen and world coordinates in Three.js for ray-plane intersections?

Screen-to-world coordinate conversion in Three.js uses normalized device coordinates to cast rays through the camera frustrum. Ray-plane intersection calculations determine exact 3D positions from 2D pointers, enabling precise drag-and-drop placement.