PDA

View Full Version : Zoom works, but not quite well



Kozersky
09-29-2015, 10:55 AM
Really did not want to post yet another topic about zoom, but I am stuck with some minor problem.

I have implemented zooming like this:



f->glTranslated(xPosition, yPosition, 0);
f->glScaled(Zoom, Zoom, Zoom);
f->glTranslated(-xPosition, -yPosition, 0);


All is good when I zoom in and out on one point, however, when I move mouse to zoom other point, the whole canvas is suddenly getting moved to another position. This happens on large zoom only. I wanted to correct xPosition and yPosition every time I change position, but that did not really work. As I understand this is the problem with glTranslated, but what I am missing and how do I fix this issue?

Thanks in advance.

Kozersky
10-02-2015, 10:38 AM
I realized that I was working with outdated OpenGL version, so this question is not relevant anymore. This topic can be closed.