Hello
I'm trying to zoom into a fractal and to do this I'm using mouse click to calculate where the centre should be and then taking away 1 from the right and top and adding 1 to the left and bottom to make a zoomed in version. This works perfectly... for 5 zooms. When the value of the left and right meet eachother the fractal starts zooming out instead of in. Is there a way to get around this? Through multiplication maybe?
Thanks!
Code:
if (myInput.mouseclick)
{
//Zoom in
left +=0.1;
right -=0.1;
bottom +=0.1;
top -=0.1;
//Generate the zoomed in texture
GenerateFractal(&data);
}