Warping issue when zooming

I am using this standard method to zoom in and out in my game:


// derive fovY value

float h = cam.getFrustumTop();

float w = cam.getFrustumRight();

float aspect = w / h;

float ho = h;

float wo = w;

float near = cam.getFrustumNear();

float fovY = FastMath.atan(h / near)

/ (FastMath.DEG_TO_RAD * .5f);

fovY += value * 1f;

h = FastMath.tan( fovY * FastMath.DEG_TO_RAD * .5f) * near;

w = h * aspect;

// if zooming produces negative h and w it should not be allowed

if(h < 0 || w < 0) {



interpolateZoom(h, -h, -w, w);

recalculateZoomRate(h, w, ho, wo);


what am I doing wrong? as i have warping issues when zooming that I cannot get rid of :S

This should help, study it, and you will see why this happens