zoomEnd, zoomStart events

I want to take some action right after zooming has finished, something like
document.addEventListener('zoomEnd', onZoomEnd, false) This obviously doesnt work.

How can I do this please. Does the scene or the camera (or even the document) detect state change events like zoomEnd and/or ZoomStart?

Zooming is tricky because it’s discrete when happening on mouse wheel for example. You have to debounce this event yourself usually. So, if a few zoom events happen with some frequency, you only fire the end after the last one.

you can’t rely on the zoom events, like @dubois said, you need to use debounce.

it’s a longstanding bug in threejs controls end event broken for mousewheel · Issue #20636 · mrdoob/three.js · GitHub

I’m not sure about this feature request since users might depend on the current behavior

i still love this response :smiling_face_with_three_hearts:

1 Like

Oh wow that is a good response!