threejs-interaction

Coordinate raycasting, OrbitControls, and mouse/touch input in Three.js scenes.

1|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Entelligentsia/skillforge --skill threejs-interaction-entelligentsia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-interaction
Source: https://github.com/Entelligentsia/skillforge/tree/main/threejs-skills/skills/threejs-interaction
Command: npx skills add https://github.com/Entelligentsia/skillforge --skill threejs-interaction-entelligentsia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Three.js projects often struggle to implement reliable user input handling, object selection, and intuitive camera controls within 3D scenes.

Core Features & Use Cases

  • Raycasting-based click detection to identify objects under the pointer.
  • Orbit and other camera controls to navigate and inspect scenes.
  • Support for mouse and touch inputs to create interactive 3D experiences.
  • Patterns for common interaction tasks like object selection, dragging, and navigation.

Quick Start

Set up a Three.js scene, attach OrbitControls for camera movement, and implement a raycaster to handle mouse clicks on objects.

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 clicks on 3D objects in Three.js?

To handle mouse clicks on 3D objects in Three.js, use raycasting to detect intersections between the pointer's screen position and scene meshes. This identifies the specific object under the cursor for selection or interaction.

How does raycasting work for object selection in interactive 3D scenes?

Raycasting for object selection casts an invisible line from the camera through the pointer coordinates into the 3D scene. It returns an array of intersected meshes, allowing you to identify and select the closest object.

Can I use OrbitControls and touch input together for mobile 3D scenes?

Yes, you can use OrbitControls and touch input together for mobile 3D scenes. This integration supports camera navigation and raycasting-based interactions across both desktop mouse and mobile touch inputs.

What is the best way to set up interactive 3D scene navigation in Three.js?

The best way to set up interactive 3D scene navigation is attaching OrbitControls for camera movement alongside a raycaster for object selection. This pattern enables users to inspect scenes and interact with objects.

Why does my Three.js object selection not work after enabling camera controls?

Object selection may fail after enabling camera controls if input events conflict or raycaster coordinates are not properly updated against the camera's new position. Coordinating input event integration ensures reliable raycasting.