home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
559b.lha
/
Ly_Gen
/
ly-gen.doc
< prev
next >
Wrap
Text File
|
1991-09-28
|
4KB
|
191 lines
Ly-Gen.doc
As you may have heard or saw, Scientific American Sept. 1991
had a particularly interesting article on the Lyapunov log
fractal and the computer graphics it produces. Being a computer
graphics buff, an Amiga owner and a fledgling C-language programer
I seized upon this opportunity to see what kind of Lyapunov
Graphics the Amiga could produce.
Many thanks to Jamie Mueller for the algorithm he posted to Genie, file
number 12088.
The Colors
The pictures in the article seemed to be done in about 100
shades of yellow to black. Since the Amiga can only do 16 shades
of a color I tried 16 shades of yellow but not with great
results. I then tried 32 colors with yellow to violet and violet
to blue. Better, but still not great eye candy. I next tried 30
colors and left colors 0 and 1 black and white for the D-Paint
tool bar. I then put one of my pictures into D-Paint II and
adjusted the palette to a wide range of bright colors. If you
don't like the colors Ly-Gen produces put the picture into
D-Paint and change the colors more to your liking.
The Pattern
Ly-Gen produces a fractal based on two attractors (a,b) and
alternates between them based on the pattern provided by the
user. ie. aabba or baaabaabb or whatever up to 16 characters.
Iterations
The number of iterations is the number of times the log is
computed per pixel. The people at Scientific American use 4000
but they clearly have a much faster processor than a 68000. To do
4000 iterations on an Amiga would take about 18 days. But this is
hardly necessary as I have gotten interesting images in as few as
10 iterations and very interesting pictures at 200 iterations in
about 21 hours.
Why Screenx?
Screenx has always been a handy P.D. program for saving
screens and it saved me the trauma of trying to write a good IFF
picture saver for my program.
To use screenx (doc file included) to save a lyapunov picture
after it's finished or while it's generating for that matter; Put
the screen in the background with left-amiga-n or pull down the
screen with the pointer. Click on the icon for Screenx. After it
starts click left button in Screenx window then click right
button. The Screenx screen will appear. Change the filename
string to something like DF1:Ly-Pic, Click on Lyapunov's Screen
name and click Save IFF. Click the right button
to exit Screenx. Restore the picture with left-amiga-m or pull up
the picture. Click upper left corner to end the program and free
up memory.
The Frame number and the Grid.
After generating a few Lyapunov pictures I felt that certain
sections could use further study in the tradition of Mandelbrot,
I wanted to blow up part of the set. To do this I divided the set
into 25 sections or a 5 X 5 Grid. To generate a blow up of one of
these sections of one of your Lyapunov pictures compare your
picture to the grid to find an interesting sector or better yet:
Load the grid into D-Paint, switch to spare screen, load Lyapunov
picture, select menu spare screen merge to front. Now you have a
clear view of how the set is divided and can easily pick a frame
of interest.
To generate one frame of a Lyapunov:
Enter Ly-Gen Pattern #iterations Frame#
ie. Ly-Gen aaabbb 200 11
The Pattern and number of iterations must match the full set
Pattern and iterations to get a true zoom in on the frame of
interest.
Ly-Gen abbaaaabbaabbaab 200 11 will generate frame 11 of the example
picture included.
Multitasking
Through no effort on my part and thanks to my Lattice 5.02
compiler Ly-Gen multitasks quite well so you can do other things
while it's running. I have a friend who found he can even play
some P.D. Games (the best kind) while Ly-Gen is running in the
background.
Aborting Ly-Gen
To abort Ly-Gen Click upper left corner and Ly-Gen will shut
down at end of current line.
Enjoy!
Roy Emmons
701 A st. #5
Lincoln, NE 68502