model-viewer
model-viewer copied to clipboard
Zoom limits: cannot expose a single intuitive zoom slider because perceived zoom depends on both FOV and orbit radius
Description
I need to limit user zoom and expose it as one intuitive slider (e.g., 0–100). In <model-viewer>, the perceived zoom changes through two different parameters at the same time:
- Field of view —
field-of-view(withmin-field-of-view/max-field-of-view) - Camera orbit radius —
camera-orbit(withmin-camera-orbit/max-camera-orbit)
Because both affect the apparent scale, I can’t define a single min/max zoom range or a single slider mapping. If I clamp FOV, changing the orbit radius still changes perceived zoom; if I clamp radius, changing FOV still changes perceived zoom.
Ask: What is the recommended way to:
- Constrain zoom to a single, predictable min/max range that users can’t exceed, and
- Drive that range from one slider value (mapping to FOV and/or orbit radius as needed)?
If there is a known approach or example to combine these parameters for a single zoom control, please point me to it.
I have the same problem, maybe there is some solution?