Jump to content

zoom in/out to mouse pointer coords


Recommended Posts

I know this has been asked many times but I am trying to understand the maths behind this function and how it works.


Basically I want to zoom in to where the mouse is pointing.


Assume the scale is always changing by 0.1. And assume I have a background and a point(x,y). If my cursor is on that point and I use the mousewheel to zoom in, the camera should scale up and focus on that point until the maximum scale has been reached (i.e: scale=1 is the max).


What are the things I need to take into account when doing that?

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...