home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / fractal112 / !Fractal / Help / CellFill < prev    next >
Text File  |  1996-10-09  |  4KB  |  69 lines

  1. CellFill: A Space Filling Cellular Automata
  2. ========
  3. This function is a bona-fide flood fill algorithm based on a cellular
  4. automata. It creates an amazing textured pattern that is beautiful in its
  5. own right, or which may be combined with other fractals to fill in the
  6. background eg. L-Systems. The initial fill points (live cells) can be
  7. specified from the menu or set by the mouse. Each cell then grows randomly
  8. in each direction until there are no adjoining unfilled cells. The strange
  9. pattern results from using different colours depending in which direction
  10. the new cell was filled.
  11.  
  12. An unfilled cell is one in the colour at the initial cell position. By using
  13. mouse selection you can specify where the initial point is and thus the
  14. colour to be filled.
  15.  
  16. The textures created can look like terrains, crumpled paper, bark, metal
  17. foil, rock faces etc, depending on the colours and initial pattern. Try
  18. different display palettes and the palette adjust facility. See the
  19. MandyGold and Pop_Fill scripts for ideas. Note that the L-System fill calls
  20. this function, so the following settings take effect there as well.
  21.  
  22. Data Items: The first 4 items specify the fill colour when converting an
  23. empty (black) cell. The directions are relative to the cell being processed.
  24. The Die colour specifies the value to be added to the cell that created a
  25. new cell (-255 to 255, 0 for no change). The Draw Colour is the value to use
  26. when using mouse selection. All colour values are physical colour numbers
  27. (0-255) - use !EditPal to see what they look like.
  28.  
  29. Menu Items: The From submenu allows the setting of the initial fill points -
  30. the corners or centre of the image. Alternatively Mouse Select allows you to
  31. choose your own start points - see below. The Presets submenu leads to a
  32. selection of preset colour values to get you going - the colours assume you
  33. are using the Default palette.
  34.  
  35. Mouse Select: When on this allows you to specify the initial fill cells. It
  36. may be combined with the preset cells. Press Redraw then press Select at the
  37. points where you want to fill from - the point will be temporarily set to
  38. the Draw Colour to show it has been selected. To end selection, press Menu,
  39. and the shape will be drawn. To create terrains draw lines corresponding to
  40. where you want the ridges. To create a volcano, draw a circle. If you press
  41. Adjust then the point is drawn but does not become an active cell. This
  42. allows you to draw barriers to enclose or alter the fill pattern.
  43.  
  44. Hints On Colouring: A good way to think of the colour schema is to imagine a
  45. point of light coming from one side. Set this side to the brightest colour,
  46. the opposite side to the darkest, and the two perpendicular sides to
  47. in-between shades. For the preset colours, the light comes from top right.
  48. Set the Draw Colour to one of the fill colours so that your outline shape
  49. merges with the fill colour.
  50.  
  51. By setting a fill colour to the initial cell colour (eg. 0) you effectively
  52. stop growth in that direction, which can lead to other interesting effects
  53.  
  54. Algorithm: A set of initial points are chosen as the live cells. A cell is
  55. then chosen at random from this set and the adjacent cells inspected. If not
  56. set (colour=initial cell colour) then the cell is coloured depending whether
  57. it is above, below, left or right of the chosen cell. These new cells are
  58. added to the set of live cells. The original cell is then killed, changing
  59. its colour by the 'Die colour' value. The process is repeated until all
  60. cells are dead.
  61.  
  62. It is possible to extend this algorithm to handle all 8 surrounding cells
  63. rather than 4, the result being a much smoother display especially when
  64. using shading colours. I've stuck to 4 because it is easier to choose 4
  65. suitable colours.
  66.  
  67. My thanks to Jean Van Mourik for this algorithm.
  68. Nb. This function works best in modes with square pixels, eg. Mode 21 or 13.
  69.