Fractal Object Editor (FOE)
ver. 1.5 (April 1994)

by Riccardo Barberi and Piotr Pieranski

Minimum system requirements:

IBM AT, PS/2  and true compatibles computers 
MS-DOS   2.0  or  higher
VGA Graphics card with VGA monitor
256 KByte of RAM
one 31/2 disk drive 
hard disk recommended
suggested clock > 16 MHz

Warning!
FOE_1_5.ZIP has to be unzipped with option -d, to obtain the correct 
subdirectory structure.
Example: pkunzip -d foe_1_5.zip

Warning!
This program operates correctly with NumLock and CapsLock disabled on your 
keyboard. 

Note:
To use this program with monocromatic or LCD screens, change the file 
name of COLOR.MON in COLOR.CFG.

Introduction and Tutorial
The Fractal Object Editor is a kind of a visual (in analogy to musical) 
instrument using which you will be able to paint with one stroke of brush 
shapes as complex as a cloud, leaf or a whole tree. 
A conventional way of panting a tree is panting separately all elements 
of its multi-level structure: the trunk, the branches, the leaves. 
The fractal way is basically different: all of the elements are painted 
simultaneously. Is this possible? Yes. But there is obviously a price you 
must pay: all elements of the object you paint will be somewhat similar.
Just have a look at the already classic Fractal Object: the leaf of the 
Barnsley's Fern (we call it that since, as far as we know, Michael Barnsley 
was the first to show us its beauty). First, try to see it as a single object. 
Then, have a look at its horizontally stretched sub-leaves: they are just 
miniature of the whole leaf. No wonder you may recognize that the sub-leaves 
themselves are built from still smaller Barnsley's Ferns.
Putting aside some deformations, the single shape you will recognize at any 
level of this infinitely multi-level structure is the shape of the whole 
structure itself. 
On one hand, this self-similarity is unavoidable: it results from properties 
of the particular nucleus around the whole program is built: 
the Iterated Function System Algorithm.
(Understanding in detail how the algorithm works is not impossible - try 
reading Fractal Geometry by P.Pieranski, 1991, or Fractals Everywhere by 
M.Barnsley, Academic Press, 1988)
On the other hand, it seems that it is the self-similarity which makes 
Fractal Objects so attractive.
As we think about it, the problem is somewhat similar to that we encounter 
in synthesis of musical sounds: the sounds are pleasant to our ear only when 
their Fourier components stay in simple rational relations. Electronic 
musical instruments make use of this elementary truth. In general, the art 
of painting fractal images using our program is analogous to the art of 
creating single notes using a musical instrument or an electronic sound 
synthesizer. The basic rules are rather simple, there is no problem to 
produce any sound but to create a sound we want is a matter of practice. 
The best way to gain some skill would be to follow one of numerous 
teach-yourself courses. The problem is that there are no such courses in 
the art of creating fractal images; the art is but in its infancy and your PC 
equipped with the Fractal Object Editor program will be but one of few 
instruments in the world using which you can practice the art. We cannot 
teach you using it at a master level. What we can do is but to teach you 
a few elementary rules and present examples of a few from infinitely many 
Fractal Objects one can create using the rules.
Before starting creating your own fractals from scratch, try to modify one 
of the ready ones. Play with the Scale, Rotation and Translation parameters 
of any of N transformations which make part of the IFS (Iterated Function 
System) you have chosen.
We will help you to select and to modify the Barnsley's Fern found within 
the Plants subdirectory. 
Start the Fractal Object Editor with the command FOE within the subdirectory 
FRACVGA on your hard disk. You will see two presentation screens. These 
screens will disappear when you push the 'space' or 'enter' keys or can 
be completely jumped by the 'escape' key.
Now you must select the Change IFS subdirectory of the main menu. This menu 
is the only active at this time (green border). The other two menus Change 
Transformations and Change World are present on the screen, but they are 
not ready (red border). 
Push the 'd' key to activate the Change IFS subdirectory option. By using 
the arrow keys, select now the PLANTS subdirectory and then push 'enter'. 
You are in the chosen subdirectory.
In the same way, with the arrow keys, you can select the Fern IFS file in 
the window that shows all files of the selected subdirectory.
Your display is now showing the Fern fractal picture in the edit window 
on the right side of the principal screen of the Fractal Object Editor. 
This Fractal Object is composed by four transformations as indicated by 
the line              
Transf...[1..4]            
below the main menu.
All white characters on your screen indicate available options. We selected 
the Change IFS subdirectory option by pushing the active key 'd' of the main 
menu.
Now you can display one of the transformations that compose the Fern by 
pushing a numeric key between '1' and '4'.
Key '1' will select the first transformation of the Fern and it will 
activate the Change transformations menu. The 'enter' key will show a 
graphic representation of this transformation on the edit window superimposed 
on the Fern paint.
By pushing a key between '1' and '4' and then 'enter' you will be able to see 
each graphical representation of the Fern transformations. 
You can also select the ShowAll mode and have a look at the graphical 
representations of all four transformations which enter the Iterated Function 
System of the Fern. 
The rule according to which the transformations are represented is simple. 
To represent the action of a particular transformation, we take the border 
of the whole square window within which the fractals are plotted and modify 
it according to this transformation. 
Action of any of the (as they are called: affine) transformations which enter 
any IFS system can be decomposed in three steps:
(i)     Contraction:
	We take the whole square and squeeze it along x (horizontal) and y 
	(vertical) directions by, respectively, sx and sy factors. As a 
	result we obtain a parallelogram of an area smaller by a factor sx*sy.
(ii)    Rotation:
	We take the parallelogram and rotate its horizontal and vertical 
	edges by angles, respectively, fx and fy.
(iii)   Translation:
	Finally, we take what resulted after application of step (ii) and 
	we translate it along the horizontal and vertical axes by, 
	respectively, tx and ty.

Any of the transformations which enters a particular IFS is responsible for 
implementing a particular element of the self-similarity features of the 
Fractal Object designed. 
For instance, transformation #3 makes the first order leafs of the Barnsley 
Fern similar to the whole Fern. 
Select now the transformation #3 (with the active key '3') and then the 
Rotate option (with the active key 'r'). Note that you do not need to push 
'enter' if you select one of the Change Transformations options after the 
number of the chosen transformation. A message on the left bottom of the 
screen suggests you to use the arrows keys to modify the selected 
transformation #3. The left arrow allows you to rotate it anticlockwise. 
As a result the Fern changes its bend.
Now the Fern is broken in small pieces made by two leaves. The Fern can 
be recomposed by rotating clockwise the transformation #4. The final result 
of these changes is a new Fern with opposite bend with respect to the 
starting one.
After that, you can return to the main menu with 'escape' and the new 
Fractal Picture can be saved on the disk by means of the Save IFS File 
option (key 's'). 
Similar actions allow to translate or scale or rotate each transformation 
and consequently to create other new Fractal Objects.
Try to play with these options!
An interesting feature of the program is the Change World option of the main 
menu (key 'w'). Here you have the possibility to scale, to rotate or to 
translate the whole Fractal Object. Note that by changing the orientation 
of a Fractal Object in the edit window, one creates in fact a new Fractal 
Object with IFS transformations different by the starting one. All 
transformations of the starting object are immediately modified to fulfill 
its new shape. In particular, the Flip option allows you to obtain a 
horizontal mirror image of a Fractal Object. 
Now we will try to paint the well known Triangle of Sierpinski, starting 
by an empty edit window. 
Go to the main menu and push the 'n' key to activate the New IFS file option. 
It allows you to start the creation of a new Fractal Object. When you start 
FOE this is its default screen. Push now the '1' key to select the unique 
transformation of this window. It corresponds to a contraction of the full 
window without rotations or translations. This simple transformation draws 
the single point in the center of the window (that therefore is not really 
empty). By using the 't' key, select the translation option and then try to 
move the graphical representation of the IFS transformation (with the up 
arrow) on the top of the edit window.
Add a new transformation using the key 'a'. It will be identical to the 
active transformation #1. With the 't' key and the appropriate arrow keys, 
move it in the left bottom corner of the edit window. 
The two IFS transformations trace the oblique line in the edit window. To 
see them at the same time, select the Show All option with the key 'h'. 
This option is shown by an additional active menu on the bottom left corner 
of the edit window.
By adding a third transformation (key 'a') and by moving it on the bottom 
right corner of the edit window (key 't' and arrow keys) the Triangle of 
Sierpinski is completed.
We hope you will enjoy this new fractal tool.
Play and learn!


General description of the Fractal Object Editor

Main Menu
	Key             Action                           
	N       This key creates a New IFS file composed only 
		of 1 transformation. It is  the starting point to create                    
		new fractal objects.
	L       This  key  closes  the  Main Menu  and  activates the                   
		Choose File   window   to   allow  to  operate  with                    
		files  in  the  active directory.
	S       This   key   saves   the  Fractal  Object  as  IFS file                         
		within the active directory.
	D       This  key  closes  the  Main Menu  and  activates the                   
		Choose SubDirectory window   to   allow   the                           
		selection  of  a  new  directory.
	W       This  key  closes  the  Main Menu  and activates  the                   
		Change World Menu  to allow global  modifications                       
		of the whole Fractal Object.
	U       This  flag  allows  you  to  choose between the                                 
		integer or real mode  to  calculate  the Fractal                                
		Object. Integer mode is faster but loses in                             
		precision.
	Numerical Keys     allows you to work with transformations.                     
		Each trsf is identified by a number. When you select                    
		a trsf, the Main Menu is closed and the Change Trsf                     
		Menu is activated.
	Esc     This key allows you to leave the Fractal Objects                                
		Editor and to activate DOS.
	Hidden options:
	P       This  key closes the Main Menu and activates the                        
		Print Mode window.      

Change Trsfs Menu
	Key                    Action                           
	S       This key allows you to scale the chosen trsf.
	Active keys to scale the trsf:
		 arrows enlarge or reduce along x or y
		  PgUp  enlarge along x and along y
		  End   reduce along x and along y
	T       This key allows you to translate the chosen trsf.
	Active keys to change the position of the trsf:
		arrows  move orizontally or vertically
	R       This key allows you to rotate the chosen trsf.
	Active keys to rotate the trsf:
		horizontal arrows       rotate clockwise or anticlockwise
		vertical arrows         shear y upwards or downwards
		PgUp    shear x to the right
		Home    shear x to the left
	P       This key allows you to change the probability                          
		associated with the chosen trsf.
	Active keys to change the probability of the trsf:
		arrows  increase or decrease probability
	M       This  key allows you to change the ordinal position                     
		number of the  active trsf  by  a  swap between this                    
		trsf and another one you must choose.
	A       This key adds a new trsf to the current IFS file. The                   
		added trsf is identical to the active trsf.
	E       This key erases the active trsf.
	+ -     These  keys  change  the  step used  to scale, to                       
		translate, to rotate and to change the probability of                   
		the active trsf.
	* /     These  keys  change  the  minimum  number  of                   
		points of the fractal image traced before to accept a                   
		new command.
	H       This  flag  allows  you to see all trsfs which makes                    
		the current Fractal Object or only the selected trsf.
	Esc     This  key  allows  you  to leave the Change Trsfs                       
		Menu and to return to the Main menu.
	Hidden options 
	U       This key gives an uniform probability to all trsfs of                   
		the current IFS file. 

Change World Menu
	Key                    Action                           
	S       This key allows you to scale the whole Fractal Object.
	Active keys to scale the Fractal Object:
		 arrows enlarge or reduce along x or y
		  PgUp  enlarge along x and along y
		  End   reduce along x and along y
	T       This key allows you to translate the whole Fractal Object.
	Active keys to change the position of the Fractal Object:
		arrows  move orizontally or vertically
	R       This key allows you to rotate the whole Fractal Object.
	Active keys to rotate the  Fractal Object:
		horizontal arrows       rotate clockwise or anticlockwise
	F       This  key  allows  you  to  obtain a mirror image of            
		the Fractal Object along x (Flip).
	+ -     These  keys  change  the  step used  to scale, to                       
		translate, to rotate the current Fractal Object.
	Esc     This key allows  you  to leave the Change World                         
		Menu and to return to the Main menu.
	Hidden options 
	N       Normalization of the selected IFS file.

Print Mode
	Key                    Action                           
	S       This key allows you to scale the whole Fractal Object.
	Active keys to scale the Fractal Object:
		 arrows enlarge or reduce along x or y
		  PgUp  enlarge along x and along y
		  End   reduce along x and along y
	T       This key allows you to translate the whole Fractal Object.
	Active keys to change the position of the Fractal Object:
		arrows  move orizontally or vertically
	R       This key allows you to rotate the whole Fractal Object.
	Active keys to rotate the Fractal Object:
		horizontal arrows       rotate clockwise or anticlockwise
	F       This  key  allows  you  to  obtain a mirror image of                    
		the Fractal Object along x (Flip).
	B       This key traces a border for the print window.
	I       This  key inverts the background and the foreground                     
		colors of the print window.
	Esc     This  key  allows you to leave the Print Mode                           
		window and to return to the Main menu.
Note:
To print the picture in the Print Mode window you need the Print Screen 
capability of MS-DOS 5.0 or of equivalent other programs external to the 
Fractal Object Editor.

Choose SubDir Window
	Key                    Action                           
	arrows  move the cursor in the four possible directions
	Enter   This  key  accepts  the current selected SubDirectory                   
		as work SubDirectory, closes the Choose SubDir window           
		and activates the Choose File window.           

Choose File Window
	Key                    Action                           
	arrows  move the cursor in the four possible directions
	E       This key erases the selected IFS file.
	C       This  key  allows  you  to  copy  the selected IFS file                         
		in a new SubDirectory,  closes  the  Choose File                        
		window and activates the Choose SubDir window                   
		to select the destination SubDir.
	R       This key allows you to rename the selected IFS file.
	D       This  key  closes  the  Choose File  window and                                 
		activates the Choose SubDir window.
	M       This  key  allows you to make a new SubDirectory.                       
		It closes  the  Choose File  window  and   activates                    
		the  Choose SubDir window.
	Enter   This key accepts the current selected IFS file as                               
		work IFS file, closes the Choose File window and                        
		activates the Main Menu.
