from visual import * from visual.graph import * nmax=1000 scene=display(x=0,y=0,width=700,height=700,background=color.white,userspin=0) scene.center=(0.5,0.5) for r in arange(0.001,1,0.005): x=0.3 for n in arange(1,nmax): x =4.0*r* x*(1-x) if n>nmax-100: sphere(pos=(r,x),radius=0.0025,color=color.red) #Now... WHEN AN OBJECT IS PICKED, #TRANSLATE THE scene.center TO THE OBJECT'S POSITION, THEN ZOOM while 1: rate(5) if scene.mouse.clicked: scene.mouse.getclick() newPick=scene.mouse.pick if newPick !=None: tempcolor=newPick.color newPick.color=color.yellow pick_r=newPick.x*4. string= "r=%7.5f" % pick_r label(pos=newPick.pos,text=string,xoffset=-5,yoffset=5) target=newPick.pos step=(target-scene.center)/20. for i in arange(1,20,1): rate(10) scene.center +=step scene.scale *= 1.037 #(1.037**19=1.99) newPick.color=tempcolor