Panning with respect to center for a 2D texture

#1

HI All,

I am using OpenGL on my desktop.

I am trying to implement a google maps type of panning on a 2D texture. The issue I am having is that it is panning with respect to my origin which is (0,0) [top left corner], I want it to pan with respect to the center.

Zooming was relatively simple, I could translate the origin to my current mouse position, apply the zoom and then scale back and everything was well. I am not sure how to approach panning because I am already using the translate function to translate to the origin.

#2

Relative panning (click-drag)? If so, what’s the difference.