InputLightweight
Orbit controls
Drag to spin, scroll to zoom.
Drag to spin the object, scroll to zoom: the standard product viewer. Right for inspecting something; wrong when the scene should feel directed, because it hands the camera to the viewer.
- Breaks when
- fights page scroll on mobilefeels like a viewer, not a scene
- Also called
- OrbitControls, TrackballControls, camera-controls
Prompts
Viewer with limits and rest
OrbitControls for a product: enableDamping with dampingFactor 0.06, minPolarAngle 0.9 and maxPolarAngle 1.75 so the underside is never shown, minDistance 2 / maxDistance 5, no pan, autoRotate at 0.4 that pauses on interaction and resumes after 3 s idle with an ease-in. On touch, one finger orbits and two fingers zoom; prevent page scroll only while the canvas is being dragged (touch-action: none on the canvas).
camera-controls with fit and transitions
Use yomotsu/camera-controls instead of OrbitControls: buttons “front / top / detail” call rotateTo and fitToBox with 800 ms transitions; a double click on a mesh dollies to it (fitToSphere with padding 1.2). Keep the smoothTime at 0.25 and explain what camera-controls gives that OrbitControls does not.
Orbit that feels designed
Replace free orbit with constrained orbit: the pointer’s x maps to ±35° of yaw and y to ±12° of pitch around a fixed target, with a spring back to center on pointer leave, no zoom. Works the same with mouse position and touch drag. Explain why this reads as a scene instead of a viewer.
Related
Resources · 2
- drei: R3F helpersMeshTransmissionMaterial, ScrollControls and Text live here.pmndrsGitHub · code · demoAug 10, 2026
- camera-controlsOrbitControls with smooth transitions and fit-to-box.yomotsuGitHub · code · demoMay 3, 2026