Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Pinch zoom algorithm

Author
Message
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 18th Jul 2016 14:08
Hi all!

Does anyone know of a really good pinch-zooming algorithm? This is trickier than I had imagined, as you have to scale -AND- translate to keep the pinch zooming centered between your fingers.

In my project I'm using sprite scaling, rather than viewport scaling. Imagine that I had a scene with two square sprites, placed a small distance apart. Using pinch-zoom I want to be able to zoom in and out smoothly with the zoom centering where the pinch began on the screen. So if I place my fingers on the left-hand sprite and spread them apart, the zoom should happen over the left sprite.

I've noticed that there are a couple of algorithms on here already, but none of them appear to perform the zoom like this... Anyone have anything in their own projects that they're using to accomplish this?

Login to post a reply

Server time is: 2024-11-25 05:43:22
Your offset time is: 2024-11-25 05:43:22