home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / fractal / progs / fractal4 / scenery / ReadScene < prev    next >
Encoding:
Text File  |  1992-07-01  |  4.4 KB  |  82 lines

  1.                               Fractal Scenery
  2.  
  3.                               by John Greening
  4.  
  5.  
  6. (The programs in this directory are my copyright but may be freely copied
  7. providing that it is not for profit and this file is included)
  8.  
  9. There are several programs that draw fractal scenery using random numbers
  10. and produce views such as might be observed from an airplane. The user has
  11. little control over the finished product as that is largely conditioned by
  12. the random numbers used.
  13.  
  14. The present programs are not like that. The views shown (at least those
  15. given as examples here) are scenes observed from ground level such as you
  16. might photograph on holiday. There are no random numbers that determine the
  17. shape of objects. The general layout is determined by your imagination, just
  18. like a painting, but most of the fine detail is filled in by the program,
  19. though again under your control.
  20.  
  21. The heart of the program is PROCfractal which is used in the examples to
  22. draw mountains, glaciers, hills, rocks, reflections and foregrounds. It does
  23. this by defining these objects as one or more triangles which are then
  24. repeatedly broken up into smaller triangles with the midpoints of the sides
  25. being somewhat displaced at each subdivision - a technique first used to my
  26. knowledge by Carpenter in the USA.
  27.  
  28. The first six parameters of PROCfractal are three pairs of numbers that
  29. define the co-ordinates of the corners of the triangle that is to be drawn.
  30. As it stands the corners are defined in the order bottom left, bottom right,
  31. top. This order can be changed but will then change the distorted shape of
  32. the resulting object.  The next parameter is a number that determines the
  33. minimum size into which the triangle is broken up. It is based on the
  34. minimum size to which the difference in the x co-ordinates of the first two
  35. corners of the triangle should be reduced. You will almost certainly have to
  36. adjust this by trial to get the effect you want. The smaller you make this
  37. number the longer the object will take to be drawn. (If you change the order
  38. in which the corners of the triangle are defined it is just possible that
  39. the x co-ordinates of the first two points will be the same, or nearly so,
  40. and no matter what you set this parameter to PROCfractal will not run. If
  41. you run into trouble change either x1 or x2 in the first line of PROCfractal
  42. to x3). The program runs in a 256 colour mode and the final parameter gives
  43. the number of the basic colour (0 to 63) in which the object is to be drawn.
  44. The program automatically uses all four tints of this colour when it breaks
  45. up the object into tiny triangles.
  46.  
  47. The program you write should define objects in the background first, then
  48. move to the middle distance before dealing with the foreground. PROCfractal
  49. contains a quantity "snowline" which has to be defined before PROCfractal is
  50. called. Parts of the object with a y co-ordinate greater than "snowline"
  51. will be drawn in shades of white. This is illustrated in the program
  52. "Glacier". If you do not want any snow make "snowline" greater than 1024.
  53.  
  54. PROCfractal uses random numbers to determine the tint of the tiny triangles
  55. into which objects are broken up. If you wish to draw a perfect reflection
  56. of an object seed the random number generator before drawing the main object
  57. and then re-seed the random number generator with the same seed before
  58. drawing the reflection. This is illustrated in the program "Reflection". The
  59. same hint applies if you wish to ensure that your drawing is exactly the
  60. same each time the program is run.
  61.  
  62. The program "Himalaya" shows how to incorporate a sprite into your drawing.
  63. In fact it is an application rather than a program and the sprite "Sherpa"
  64. is contained in the sub-directory.
  65.  
  66. A further example of my fractal scenery, with a fractal tree in the
  67. foreground, appeared in RISC User vol.2 issue 3 p.6.
  68.  
  69. In designing a scene positioning of objects can be critical. To help you in
  70. this I have included a transient utility, an assembled program "Grid", which
  71. draws a grid of lines at every 100 graphics units and also, except in
  72. two-colour modes which will not be of concern to you in the present context,
  73. at the intermediate 50 graphics units positions. This program has its own
  74. ReadGrid file.
  75.  
  76. The other help you might need is in deciding the number of the colour to use
  77. for particular objects. I have written another transient utility "Cols" to
  78. be of assistance in this respect. It also has its own ReadCols file.
  79.  
  80. John Greening
  81. 15 Pentland Crescent
  82. Edinburgh, EH10 6NS