mandy21

advertisement
-----------------Mandy version 2.1
-----------------Mandy generates a mandelbrot set in a variety of resolutions, and with a
variety of palettes & functions.
Mandy 2.1 is free, but upgrades are available only through order. See
bottom
of document for details.
Usage
----mandy [mode]
Mode is one of the folowing:
available
modes
0
1
2
3
4
-
320x200
640x480
800x600
1024x768
1280x1024
if no mode is specified, you will be prompted to supply it.
Technical Stuff && Microsoft Windows
-----------------------------------Mandy was written using Borland C++ 3.1 and Spyro Gumas's VSA256 graphics
library, which I got from the book "Tricks of the Graphics Guru's".
Intrestingly enough, said book also included a mandelbrot generator,
which
was 4 times slower than Mandy.
You need an SVGA card with VESA BIOS loaded to run Mandy. If you don't
have
VESA BIOS either built into your card or pre-loaded, find the appropriate
driver in the "drivers" directory (they are sorted by manufacturer), &
run it.
If VESA BIOS isn't installed, you will be warned on start up. If you
install
the wrong one, Mandy will probably tell you that none of its video modes
are
supported.
Mandy runs great under Windows! Here is how to set it up. First, decide
what
group you want Mandy to run in... Main, Start Up, etc. Then under the
File
menu, choose New. Windows will ask you whether you want a new item or
group,
choose item. Hit the browse button, find "mandy.pif", it's in the same
directory as "mandy.exe", and hit ok. Be sure to set the working
directory
at this point, the default is c:\mandy. To set up Mandy's icon, Hit the
"Choose Icon" button, then the "Browse" button. Select "mandy.ico",
and hit ok. You're all set!
What's a Mandelbrot?
-------------------Mandelbrot sets live in the complex plane. To generate a set, you take
the simple equation Zn+1 = Zn ^2 + C, Zo = 0, and note whether it goes
to infinity or not. Note that Z and C are complex numbers. Colors are
determined by one of three methods: "scalar", "logarithmic", or "sine".
The scalar method iterates the above equation until the normal of Z
exceedes 2 or the number of iterations exceedes 256. If the number of
iterations exceedes 256, it assumes the point will never reach infinity
and assigns it a color value of zero. Otherwise it assigns a color based
on how many iterations it had to go through before Z exceeded 2. This
generates a traditional set. The logarithmic method runs every point
through 8 iterations, and then assigns it a color proportional to the
logarithm of the norm of Z. This is faster than the traditional method,
and gives the old set a new and intresting look. The sine runs every
point
through 4 iterations, takes the sine, and assigns colors based on the
result.
You would think that this would destroy all the structure of the set...
but
this isn't the case. Try it and see :) Many floating point calculations
are
involved for all three methods, so mandelbrot generation tends to be slow
on many machines, but the result is a seris of amazingly beautiful
images.
Instructions
-----------Mandy has two basic modes: image generation and command. When Mandy first
starts, it is in image generation mode, any key stroke will interupt it
and
place you in command mode.
Image generation mode:
There are 4 methods of image generation: Draft, Rough, Precision, and
Fast.
Precision is the slowest, but results in the absolute best possible
image.
It checks every pixel on the screen. Draft plots one out of every ~100
pixels. Rough plots one out of every ~25 pixels. Draft and rough are best
used for a quick approximation of a section that you aren't really
intrested
in, but want to expand a section of. Fast tries to reduce the number of
pixels that needs to be checked without losing image quality. Basically,
it checks four points, and if they give the same result, draws a filled
box. If they aren't, Fast checks every pixel within the four points. Fast
is a lot, well, faster than Precision, and looks almost a good. When you
first load Mandy or when you expand a section of an image, Mandy first
runs
a Rough approximation and then redraws the screen in Fast. This is so you
have a general idea what the screen will look like before waiting for the
full generation. You can enter command mode at any time by hitting a key.
Command mode:
A hollow box will appear in the upper left hand corner. This box can be
moved across the screen by use of the numeric keypad or arrow keys. From
this point you can expand the section of the set under the box, change
the
size of the box, change the display algorithm, or switch back to image
generation in Draft, Rough, Precision, Fast, or Ultra mode.
key strokes:
+
q
E
e
D
d
R
r
P
p
F
f
3
t
increase box size
decrease box size
quit Mandy
expand screen (zooms back away from set)
expand box (zooms into screen)
Draft entire screen
Draft interior of box
Rough entire screen
Rough interior of box
Precision entire screen
Precision interior of box
Fast entire screen
Fast interior of box
generates a 3D plot of the screen (cool)
alternates display type between normal, log, and
sine
O.K. lets go over an example: You load of Mandy, and it starts to
generate
a Rough image. After the Rough is complete, you decide to skip the
Precision
image generation and blow up a section in the upper right hand side. So
you
hit a key, and after Mandy finishes its current row, the command box pops
up. Scroll it over to the right area, and make the box bigger with the
'+'
key. However, you suddenly grow curious as to what the Precision image
looks
like. You could hit 'P' to Precision generate the whole screen, or you
could
hit 'p' to Precision generate just the area under the box. You like what
you
see, so 'e' to expand the box...
Palettes
-------A palette defines the "colors" that a program uses. It discribes each
color
in the image by giving it a red, a green, and a blue value. This is known
as an RGB (red green blue) set. Unlike prior versions of Mandy, 2.1 and
above support multiple, defineable palettes. In the "pal" directory, you
will note a variety of palette files, all ending with a ".pal" extension.
If you don't have a "pal" directory, you probably didn't uncompress Mandy
with the proper arguement. Try "pkunzip -d Mandy.zip", or just create a
directory called "pal" and move everything that has a ".pal" extension
there.
When you first load up, Mandy, unless told otherwise, uses "chaos.pal".
To load a diffrent palette before using Mandy, just type "use name",
where
name represents the palette desired. I.e., to use the palette "wild.pal",
which is in the "pal" directory, just type "use wild". Mandy will use
this
palette until you specify another.
If you want to create your own palettes, you can use one of the two utils
I
provided, or hack your own. The code for all utils is provided in the
"src"
directory.
TXT2PAL textfile [palette]
This takes a text file which contains RGB information, and compiles it
into
a .pal file. If no palette file is specified, it will create one called
"temp.pal". The text file must be 256 lines long, one line for each color
entree. Each line must have three numbers on it, seperated by spaces. The
numbers should be between 0 and 255, higher numbers are wrapped around...
256 becomes 0, 257 becomes 1, etc. The first, second, and third numbers
represent the quantities of red, green, and blue in the color. For
example,
to create the all-red palette "red.pal", I created a text file like so:
0 0 0
1 0 0
2 0 0
3 0 0
(etc)
255 0 0
The first line is the background color, and is also used for the interior
of
the mandelbrot set. Lines 2-256 represent the colors used as you get ever
deeper into the set. Color 256 is used for the interior of the set while
3d rendering (unless you use the 'I' script command to set the maximum
iterations, then the color used is equal to the maximum iterations, see
the section on scripts for details), and color 129 is used as the
background
color in 3d images. The command box is color 129 in 2d mode, and color 1
in 3d mode.
BMP2PAL bitmap [palette]
This takes a standard 256 color windows bitmap, and grabs the palette off
of it. The palette is saved as "temp.pal" unless you specify otherwise.
If the bitmap follows conventional palette structuring, the predominant
shade of the bitmap will be mapped to the outermost color of the set.
If you have a picture of a blue sky, with occasional fluffy clouds, your
mandelbrot will be blue, with a fluffy white edge. This can be a lot of
fun, and the results can be quite surprising. Try a picture of flames, or
an underwater scene, for some nifty shades.
History
------Version 1.0
Slow first try, it worked but not well.
Version 1.3
Sped up routine by factor of 2, added 3d generation.
Beta tested.
Version 2.0
Sped up routine by factor of 9, think I've trimmed all the junk off now.
Minor bugs fixed, changed image generation functions, polished
everything.
Version 2.1
Sped up that little box and 3d generation by a factor of 4.
Support for multiple palettes added... much prettier.
Hugely increased supported cards. Improved 3d display by using
gouraud shaded polygons rather than single shaded planes.
Known bugs
---------No known bugs, only unknown ones :)
1280 mode hasn't really been directly tested, I don't have a monitor
capable
of it. Should work, if not let me know.
Upgrade Plans
------------For 3.1 (finished)
Save screen as standard Windows bitmap, generate log file which can later
be used as a script (i.e., mandy scriptfile, goes through script one step
at
a time, great screensaver). Easy to write or edit, good way to create
slideshows or animations of your favorite images if you are short on hard
drive space (and who isn't?) Some nifty bitmap palette manipulation tools
included.
For 4.0 (sometime middle/late 1994):
Improved 3d stuff (can specify viewer's position), true script language
with
defineable fractal functions. Not just mandelbrots anymore!
Up in the air (maybe in version 4.0, maybe never):
Mouse support, support for MIDI files as background music, windows
version, support more graphics formats (noteably GIF and JPG).
To order an upgrade
------------------Send $20 over my way:
Daniel Lemberg
110 West 39th Street
Apartment 515
Baltimore, MD 21210
And I'll ship you the latest version.
------------------------------------------------------------------------I worked hard to make Mandy a beautiful and useable product, and
sincerely
hope you enjoy it. Feel free to e-mail me at lemberg@jhunix.hcf.jhu.edu
with comments, suggestions, and for information on version 4.0. (as in,
when will it be done?)
-------------------------------------------------------------------------
Download