How to get current zoom value when user zooms?

Is there any API to receive it?

I tried:

// this.controls is a OrbitControls instance
this.controls.addEventListener("change", (event) => {
  console.log(event);
})

But I cannot find where the zoom value is.

1 Like

OrbitControls do not really zoom - they dolly, just calling it zooming.

What you’re most likely looking for is this scale value, but unfortunately it doesn’t seem to be available outside of the controls context.

1 Like

It depends on the camera:

  • for OrthographicCamera the zoom is stored in the camera itself (and it is called zoom) → Live demo
  • for PerspectiveCamera there is no zoom. You can estimate it by measuring the change in the distance → Live demo
1 Like