I am using an Orthographic camera to display an image. I have created my own zooming & panning controls, but I am not content with the zooming. When I scroll forward I add 1 to the camera.zoom and when I scroll backwards I subtract 1 from camera.zoom. This all works fine it zooms in and out, but when you zoom in it starts out with what looks like bigger “steps” and slows down when zooming in furthur. So it takes alot of scrolls to get a close up of the image.
Something more visual.
No zoom, zoom level 0:
First scroll, zoom level 1:
It scrolls in a whole lot even though it only went forward by 1. Here’s how I do it:
this._camera.zoom += direction;
This code gets called every time the scroll event is triggered, and direction is -1 when scrolling backwards & 1 when scrolling forwards.
Here’s another example for when you’re close up to the image:
Zoom level 20:
Zoom level 21, one scroll forward:
It barely shows any zooming.
I am looking for a more consistant way of of zooming in & out of the image.
Anyone who might have an idea please let me know!