• guyhillyer163

Hi, I've been poking around with this little program off and on for a couple of weeks. It can zoom in but not out. It has been run only on an iPad 2. It is kind of slow -- ideas for making it go faster would be welcome.

https://gist.github.com/4240849

• guyhillyer163

tmhrtly, very nice! I love the continuous color gradation.

• guyhillyer163

I tried running the program on an iPhone 3GS and it worked as expected, so the display problem must be related to the retina display, as C0deH4cker suggested.

Ole wrote, in another posting on this forum: "The coordinate system for retina and non-retina screens is the same..., so that the same code works unmodified on both kinds of screen." If that's what's intended, then this problem is looking like it might be due to a Scene bug. I'd be happy to find that there's a workaround, but I don't have a retina device to experiment with.

• guyhillyer163

C0deH4cker, I borrowed an iPhone 4 and I see what you mean. I don't understand it. I am really surprised that setting INCREMENT to 0.5 works AT ALL!

PKHG, the vertical lines are drawn from left to right in ten passes which should build up the whole graph. You can avoid the line-skipping behavior so that it draws the whole graph in one pass by setting INCREMENT to 1.

• guyhillyer163

As I understand it, this iteration is the essence of the Mandelbrot calculation. The result of one iteration is fed back into the next iteration. If the distance of z from zero doesn't exceed 2.0 after some number of iterations then the value of c is considered to be a member of the Mandelbrot set. Such values are colored black on the graph. Other values of c take different numbers of iterations to exceed 2.0. This number of iterations ("the escape velocity") determines the color of the corresponding point on the graph. The maximum number of iterations is arbitrary and determines the precision of the resulting graph.

• guyhillyer163

Hi, this code https://gist.github.com/4191121 tries to dynamically build up an image and display it at each step. It calls load_pil_image once for every invocation of Scene.draw. I'm guessing this is too much, because pythonista crashes after a short while. Is there a better way to do something like this? Is there a way to unload a loaded image?

Thanks

• guyhillyer163

Hi, I have a class derived from Scene that implements should_rotate:

``````def should_rotate(self, orientation):
print 'should_rotate called with', orientation
return False
``````

I expect this to be called when the screen changes from portrait to landscape, but I never see the message printed. Also I expect the return value to inhibit the rotation.

I am not passing an orientation argument to the run method.

Perhaps I misunderstand how this is supposed to work?

• guyhillyer163

Good to know, thanks.

• guyhillyer163

I was trying to use a Layer in such a way that moving or removing the Layer would reveal the formerly obscured part of the underlying Layer. But it didn't work in that way, and I've concluded that it is not intended to work that way. In the examples, the entire display is blanked and re-drawn for every invocation of Scene.draw(), and so there's no need to preserve the underlying pixel values. Can you verify that this conclusion is correct?