You can do it as follows:
ZOOMSQRT = sqrt(ZOOM);
glScalef(1.0f/ZOOMSQRT, 1.0f/ZOOMSQRT, 1);
glScalef(1.0f/ZOOMSQRT, 1.0f/ZOOMSQRT, 1);
or use glPushMatrix / glPopMatrix to restore the original matrix to scale:
glPushMatrix();
glScalef(ZOOM, ZOOM, 1);
[do whatever you like here...]
glPopMatrix(); // now it at normal scale again
[do other things here...]
source
share