zoom=2.0 zoom_scale_step=math.pow(zoom,1./20.) while 1: #Now... WHEN A POINT IS CLICKED, #TRANSLATE THE scene.center TO THE CLICKED POINT, WHILE ZOOMING if scene.mouse.events: MOUSE_EVENT=scene.mouse.getevent() if (MOUSE_EVENT.press=='left' or MOUSE_EVENT.press=='right' or MOUSE_EVENT.press=='middle'): if MOUSE_EVENT.press=='left': #ZOOM IN scale_factor=zoom scale_step=zoom_scale_step elif MOUSE_EVENT.press=='right': #ZOOM OUT scale_factor=1./zoom scale_step=1./zoom_scale_step else: #NO ZOOM scale_factor=1.0 scale_step=1.0 target=MOUSE_EVENT.pos c=complex(target[0], target[1]) scene.title="a=(%10.7f,%10.7f) c=(%10.7f,%10.7f) MAX=%10.7f" % (a.real,a.imag, c.real,c.imag,MAX) MAX /= scale_factor if scale_factor>=1: bins=julia(a,c,MAX,bins) draw_region(c,MAX,bins) step=(target-scene.center)/20. for i in arange(0,20): rate(50) scene.center +=step scene.scale *= scale_step #(zoom_scale_step**20.=2.0) scene.center=target