Page 1 of 1

Zooming - Movement behavior

Posted: Sun Feb 03, 2019 12:45 pm
by Towkin
Hello!

I'd like to request a change in behavior. The way the camera moves when zooming using Ctrl + Scroll Wheel is very... odd. When you scroll, the camera moves with the vector of mouse screen position - screen center. While not entirely useless, it's very difficult to figure out where you land with each zooming level.

The way I'd request the movement to behave, is for the cursor to stay on the same world coordinate position when zooming. I'll demonstrate with a few lines of pseudo-code.

Current way is something along these lines:

Code: Select all

// Zoom delta in range [-1, 1].
Camera.Size *= Pow(1.1, delta);
Camera.Position += ((GetMouseScreenPos() / GetScreenSize()) + (GetScreenSize() / 2)) * Camera.Size * SomeScalar;
The way I'd suggest it should be would do the translation based on the old pointer coordinate:

Code: Select all

var oldMouseWorldPos = Camera.Transform(GetMouseScreenPos());

// Zoom delta in range [-1, 1].
Camera.Size *= Pow(1.1, delta);

var newMouseWorldPos = Camera.Transform(GetMouseScreenPos());
Camera.Position += oldMouseWorldPos - newMouseWorldPos;

Re: Zooming - Movement behavior

Posted: Fri Feb 08, 2019 11:53 am
by Kanchou
Team's looking into it. Question: are you using the OSX or the Windows version?

Thank you!!

- Alejandro

Re: Zooming - Movement behavior

Posted: Fri Feb 22, 2019 11:59 am
by Towkin
Kanchou wrote:Team's looking into it. Question: are you using the OSX or the Windows version?

Thank you!!

- Alejandro
Hi again! Sorry for the long delay.

I'm using OWM on Windows only.

Re: Zooming - Movement behavior

Posted: Thu Mar 07, 2019 12:28 am
by Kanchou
Towkin wrote: Hi again! Sorry for the long delay.

I'm using OWM on Windows only.
No problem. Thank you for the feedback!

We'll try to get this into the next version :).