landscapes

Posted by Natasha Shapiro on September 06, 1999 at 22:21:43 :
I was wondering how all of the graphical fractal landscapes programs are capable of working really fast. I have seen programs that show flights over such landscapes at enourmous speeds. Wouldn't they require so many calculations that it would be impossible to achieve such speed? Your landscape applet, for example, generates much simpler landscapes, but still takes some time to generate.
Answer:
If programs that showed flights over fractal landscapes actually had to do all of the calculations necessary then the programs would be... let's just say very slow. The fact is, to generate such program, a programmer first spends his time generating a very good-looking preset landscape. The preset landscape is stored as an array and all the program has to do is draw an image from that array -- without calculating the values for it. The reason our applet is slower is because it generates a new array every time, which requires thousands of calculations.
You might also be surprized by programs which allow you to fly over lanscapes endlessly (you can't store an infinite array, can you?). There is a very simple trick to such programs as well. What they do is repeat the landscape over again when you get to the end of it, sort of as if it was wrapped around a globe. In the Mars program, for example, you can't memorize every fractal mountain in every detail, so you don't recognize it when flying over it for the second time.
Thank you for using the Fractals Unleashed Q & A utility. We hope your question has been answered clearly.