What the controls do
In three.js the tool is called OrbitControls: it orbits the camera around a target, dollies (zooms) and pans, and keeps the up direction [1]. Dragging with mouse or finger rotates; the wheel or two fingers zoom. Ready-made components such as model-viewer bring similar controls.
Limits that protect visitors
A completely free camera quickly ends up looking up through the floor, or so close that nothing is recognisable. Sensible limits therefore include [1]:
- Distance: minimum and maximum zoom (
minDistance,maxDistance) to suit the product size. - Tilt: an upper polar angle (
maxPolarAngle) so the camera cannot dip below the ground. - Panning: often disabled so the product cannot slide out of frame.
- Inertia (damping): feels smoother, but the controls then have to be updated every frame [1], which costs processing time even when nothing else changes.
Touch and scrolling
On phones, rotating the model competes with scrolling the page. An embedded viewer should not trap visitors inside the 3D area, see scroll trapping. The entry on touch gestures covers the usual gestures.
Preset views
Many visitors never rotate the model themselves. Buttons for fixed views (front, corner, top, detail) that the camera glides to are therefore worth having. They also matter for keyboard use.
In the spiral stair configurator (example configurator, fictional product) panning is off, the tilt stops just above the floor and the zoom range adapts to each view. The 3D product viewer page covers embedding.