home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Computers
/
CreativeComputers.iso
/
shareware
/
fractals
/
dem
/
dem.docs
< prev
next >
Wrap
Text File
|
1994-11-17
|
8KB
|
182 lines
DEM
Mandelbrot generator using the Distance Estimator Method.
(c) 1989 by Lars R. Clausen
Why another MandelBrot program?
Why now yet another Mandelbrot generator, you may ask. After all, we have
about a dozen of them, with MandelVroom 2.0 ranking as the absolute best.
But this one is slightly different from all others seen so far in that it is
suitable for making black-and-white pictures that does not end up fluffy and
no way like the color versions.
The method used for this is one I gleaned from 'The Science Of Fractal
Images', where it was called Distance Estimator Method, or for short DEM.
This works by actually finding the distance to the MandelBrot set itself,
instead of just seeing how many iterations are used. If then you make all
pixels longer than half a pixel away from the MandelBrot set white, and the
rest black, you will be quite sure that you get all those small wiry
branches on the picture, without making the inner parts a big black block.
So you actually get a nice black-and-white picture, showing most precisely
the MandelBrot set.
I will not get into theoretics here, those who want it may use the source
code or read the book. Suffice to say that it takes more time than usual
generators, and a 68881 has a greater effect on it than usual. For those of
you who do not feel familiar with the MandelBrot set, I suggest that you
take a look at MandelVroom 2.0 before using this program, as you can get the
look of it there.
How do I run it?
There are two versions of this program, one that uses 68881 processors
directly (DEMTurbo), and one that calls the MathIEEEDoubTrans.library
(DEMNormal). The program you can use will hereafter be called DEM, as the
only difference is in the speed.
To run this program, you may CD into the directory and just run
DEM
from there, using the DataFile provided. You may also call the program
directly by giving it a lot of arguments, like this:
DEM XMin XMax YMin YMax MaxIt [L|W|H|G|F] SaveFileName
The four coordinates are floating point numbers, MaxIt is an integer,
maximum 2000, the single char is, well, a single char, giving the size of
the picture, and SaveFileName is the name under which the finished picture
will be saved. These options will be explained more clearly below.
Workbench icons have been supplied for both versions, using IconX. It
doesn't do any copying or checking, it just executes it.
An example:
DEM -0.0576 -0.0052 -0.99959 -0.97279 100 F Wriggly.ILBM
If you have made your own datafile, and not stored it in your current
directory, you may also call DEM thus:
DEM DataFileName
If it can't find that file, it will close down and write 'Can't open
file'.
Typing:
DEM ?
will make DEM display a small usage text and then exit.
To exit DEM, press the closeing gadget in the upper left corner.
I have supplied a makefile for the program under Aztec C 3.6. For
Lattice-users, recompiling should not be too difficult, though I have not
tried.
How does the datafile work?
The datafile, normally called DEMDataFile, is a list of areas of the
MandelBrot set that are to be made, how they are to be made, and what name
they shall get when saved. The data are the same as used as arguments from
the CLI, except that a ; (semicolon) is placed between them. Each set of
data will use one line. Spaces may be placed as you want it, except around
the size parameter, which should have none between it and the semicolons.
Also beware that the SaveFileName will be everything from the semicolon
after size to end of line, including any spaces. I know this could have been
made better, and if I get the time and energy, I will make a better version,
maybe even with Intuition Interface. But for now, this works.
The point in having a definefile at all is that you can make a big
definefile, and then go away on your holiday, or just let it work overnight,
and have DEM make a lot of pictures without you intervening.
The first four numbers are simply the coordinates for the picture. XMin
and XMax will be used to ensure the aspect ratio of the picture, in effect
by changing YMax so that the correct ratio will be used, thereby avoiding
streched pictures. This means that there is no point in changing YMax to
correct a pictures size.
MaxIt is fairly simple: it will maximum be 2000, and the larger it is,
the more time the generating will take, but a large MaxIt will ensure more
details around the actual set, especially when you make a picture with a
very small area. Look to MandelVroom to see the effects.
The Size parameter can be one of five:
L: LoRes - 320x255 (320x199 for NTSC). Very good for testing areasize.
W: WorkBench size - 640x255 (640x199 for NTSC). If you'd like to have a
picture of this kind as a background picture on the WorkBench (using SimGen
or something like that), this is the way. Because of the great difference in
horizontal and vertical resolution, some pixels may disappear, so a better
result would often be gotten by resizing a Full size picture in DPaint or
somesuch.
H: HiRes - 640x511 (640x399 for NTSC). Simply fills the screen in the
highest possible resolution.
G: GPrint size - 960x1023 (also that for NTSC). A picture of this size
will fill a normal a4 paper when printed out using GPrint in High density,
or one-quarter in Ultra high density.
F: Full size - 1024x1023 (also that for NTSC). This is the biggest BitMap
I have been able to make. It's pretty big, but I'd like one to fill an A4
paper in Ultra density.
The picture, when finished, will be placed in the current directory under
the stated as SaveFileName.
To abort a drawing ithout exiting the program, press Esc. The picture
will not be saved, and the next one will begin generating.
What do I do when another program crashes while DEM runs?
As I have been making some fairly dangerous things while having DEM
generating in the background, I found it necessary to make it possible to
save the picture before having finished it. This is done by pressing 's',
whereupon the picture will be saved under its name, whether or not that file
already exists. To make DEM continue generating after a reboot, just try
making that picture again. It will try to load it, and if it gets it, it
will scan through the picture, resuming one line before the first totally
black line it finds, or at line 0 if the first line is black. So, to loose
as little as possible of the CPU time used, you should press 's' just before
making anything big and/or dangerous. Then it will resume where it had come
to next time it is run. This also gives a method of error recovery, if
anything was damaged by transmission, GURU's or whatever. Just remove the
damaged lines all the way over, and DEM will make them OK the next time it
makes that picture.
Who may I give this program to?
As this program is PD, you may copy it to anyone you like, as long as
this document remains with it, and you don't take more money for it than a
few dollars for disk and time usage.
You may use the source code for your own programs if you want to. If you
make any changes in it, like bugfixes, improvements or the like, please send
the changed version to me before you distribute it.
I will, as usual, not take the responsibility for anything this programs
does, be it damage your disks, computer, mental health or anything else.
If you like DEM, please send a note saying thanks, bugreports, ideas, $$$
or whatnot to:
Lars R. Clausen
Hougσrdsvej 29
8220 Brabrand
Denmark
Fidonet nr: 2:230/22.34