Tedious setup of basic functionality for orthographic camera

We are using an orthographic camera in our app. I realized that just setting the camera mode to orthographic wasn’t enough for an enjoyable UX.
To make it really usable (e.g. zoom with mouse wheel, sensible panning), I had to apply a few tweaks.
It might make sense to include some of the tweaks in the default setup.

Here’s my PG: https://playground.babylonjs.com/#VE7VH3#5

UPDATE: Instead of window resize events, I now use a mutation observer to specifically listen to width/height changes of the canvas: https://playground.babylonjs.com/#VE7VH3#6

Looking forward to your feedback.

1 Like

I like it maybe a helper would help with the setup ?

@PolygonalSun any thoughts ?

1 Like