3d-camera-interaction

Drag and pan 3D models in Three.js with boundary-aware camera-distance mapping.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/StarrySerendipity/N.E.K.O --skill 3d-camera-interaction-starryserendipity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 3d-camera-interaction
Source: https://github.com/StarrySerendipity/N.E.K.O/tree/main/.agent/skills/3d-interaction
Command: npx skills add https://github.com/StarrySerendipity/N.E.K.O --skill 3d-camera-interaction-starryserendipity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Three.js-based interaction approach for dragging and zooming 3D models with proper boundary detection, solving mouse-to-model movement desynchronization and partial visibility after scaling.

Core Features & Use Cases

  • Dynamic mapping of mouse deltas to world-space translation based on camera distance and FOV.
  • Boundary-aware panning using the model's screen-space bounding box to keep content visible.
  • Camera-distance-aware interactions to ensure consistent movement across zoom levels.

Quick Start

Integrate the dynamic pixel-to-world mapping approach to enable dragging 3D models with boundary-aware panning in your Three.js scene.

Frequently Asked Questions about 3d-camera-interaction

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

FAQPage Schema
How do I fix Three.js dragging when the 3D model moves slower or faster than the cursor?

To fix Three.js dragging desynchronization, apply dynamic pixel-to-world mapping that calculates world-space translation based on the current camera distance and field of view, ensuring movement matches cursor displacement across varying zoom levels.

How do I prevent a 3D model from disappearing or panning out of view in Three.js?

Prevent a 3D model from disappearing by implementing boundary-aware panning that uses the model's screen-space bounding box for visibility checks, automatically clamping movement to keep content visible within the camera viewport.

What is the best way to maintain consistent 3D object dragging across different camera zoom levels?

The best way to maintain consistent 3D object dragging is using camera-distance-aware interactions that dynamically adjust pixel-to-world conversion, ensuring uniform movement speed regardless of how close or far the camera is zoomed in.

Does this boundary-aware panning approach work for interactive 3D viewer scenarios?

Yes, boundary-aware panning works for interactive 3D viewer scenarios by enabling precise dragging, panning, and zooming of models while applying bounding-box-based visibility checks to ensure a consistent user experience.

Why does my 3D model become partially visible after scaling in Three.js?

A 3D model becomes partially visible after scaling because standard dragging lacks distance-aware translation, which requires dynamic pixel-to-world conversion and bounding-box checks to maintain full visibility during zoom interactions.