Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math to scale a map based on two finger pinch? #1333

Open
rygo6 opened this issue Apr 9, 2019 · 0 comments
Open

Math to scale a map based on two finger pinch? #1333

rygo6 opened this issue Apr 9, 2019 · 0 comments

Comments

@rygo6
Copy link

rygo6 commented Apr 9, 2019

I am having trouble figuring this out.

Lets say I have two fingers, and they raycast to project their position on the surface of the map. So then I have two world positions on the map. I want to then pinch to zoom, so as these two world positions on the map get closer, the map zooms out. BUT the condition is I want the map to stay locked exactly on those two world positions as they move. The current 'pinch to zoom' example just zooms at an arbitrary rate in relation to the change in pinch. How do I calculate the exact change to the zoom value so the map zooms so as to appear locked to the two world positions on it's surface projected from the fingers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant