PDA

View Full Version : 2D Mandelbrot Set, can't implement zoom



wait what huh
10-02-2011, 02:25 PM
Hello. This is my first time posting here. I am currently in a computer graphics college course so I am very new to OpenGL. I have to draw, pixel by pixel, the Mandelbrot Set (http://en.wikipedia.org/wiki/Mandelbrot_set) and implement zooming capability. My program draws the image but I don't know where to go from here for the zooming portion.

The zoom will receive two mouse clicks as input (upper-left and lower-right corners) and redraw.

Using glutMouseFunc() I have created a function which reads the coordinates of the mouse clicks. Now I do not know what to do with these numbers in order to zoom.

If there is any more information required to assist please let me know. Any insight will be appreciated.

skypers
10-02-2011, 10:38 PM
Hello,

Well, the Mandelbrot set is initially viewed with window settings (-2;1) on X axis and (-1;1) on Y axis.

Using this, you pass a several number of complex numbers representing this covered area. Zooming is just changing these window settings :) The relation between your zoom rectangle and the window settings is trivial ;)