-
Faster Repaint
I have an application that has a fractal already drawn, but I have three JSliders that allow the user to zoom in out, shift the x axis, and shift the y axis. I think it's plotting around 160,000 points, and the refresh is quit noticible. I was wondering if there was a way to make this faster....And if so, how?
I'll post a few pictures seperate.
-
Re: Faster Repaint
-
Re: Faster Repaint
This is zooming in, it takes a little while to refresh this...It's not bad at all on my computer, but on other's it's really slow.
-
Re: Faster Repaint
Do you actually have to paint the fractal? I mean couldn't you compute the visual element in a buffer then just paint and image off screen?
Alternativly what is your painting code like? are you forcing a repaint on the entire fractal? or just the visible or dirty regions?
-
Re: Faster Repaint
Also, from a usuabilty point of view, would it not be easier, for the user to click and drag the image to move it around, and maybe the scroll wheel to move in?
Bearing in mind they'd have to be clicked on the image to do this you'd have a start point to mark a dirty region for repainting!, you could write some quite optimised code to just paint the area the user wants to view...
Just a thought, let me know how the ground lies and i might be able to come up with a suggestion or method, at work we have a similair problem, we have an Open GL renderer using Joggle and the amount of data we are rendering is crazy, so we had to write alsorts of weird and wonderful routines to speed up the painting.....
-
Re: Faster Repaint
Ok. The painting of the fractal is quit complex..I mean, first of all you have to have this different class that will calculate Complex numbers since you will be dealing with imaginary numbers. I guess that wouldn't matter too much, but since it's recalculating everything, we might run into trouble. I can provide ALL the code if you like, but the workings is VERY hard to understand, and you would have to spend a lot of time figuring out what is going on. I got the extra class that computes complex numbers off of the internet, but I don't feel like that would cause the repaint to be slower.
See, I was also thinking of using a BufferedImage, but there would be a couple of questions raised:
1) How would I zoom in/out of the image?
2) How would the shifting work?
Your idea about using the scroll whell is pretty cool, but I don't have a scroll wheel on my laptop.
I am thinking about using your idea of clicking and dragging..it sounds like the best way.
You asked how I was painting the fractal....Each time one of the Sliders is moved, the WHOLE fractal is repainted.
If you need the code, or any other information let me know.
Thanks for the help.
-
Re: Faster Repaint
not promising anything, but i'll have a look, you canemail me it at [mailed] or post it on here if its not to big....
We could always pre paint a lot of zoomed levels, and store them then just switch out the image you see when you move or scroll?!
-
Re: Faster Repaint
I just emailed it to you.