home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 049.lha / atv3d.doc < prev    next >
Text File  |  1986-11-20  |  3KB  |  71 lines

  1. /*
  2.  * sc.c - fractalish terrain generator.
  3.  *
  4.  *   Date:     March 5, 1987 (original version sometime in 1985)
  5.  *   Author:   Chris Gray
  6.  *   Language: C
  7.  *   System:   Amiga
  8.  */
  9.  
  10. /*
  11.  * Badly hacked for 3d and Dynamic allocation under 16-bit integer Manx:
  12.  *
  13.  *   Date:        July 26, 1987
  14.  *   Barbarian:   Howard Hull
  15.  *   Implements:  (some) Dynamic allocation code from Ray Bovet, and
  16.  *                (considerable) custom requester code from John Draper's
  17.  *                 gadget tutorial.
  18.  *                Devil's Post Pile relief generator whipped up by yours
  19.  *                 truly on the spot.
  20.  *
  21.  *                 Structured design?  Structured design is for lords and
  22.  *                 prima donas.  The rest of us have to make do, even the
  23.  *                 geniuses among us:
  24.  *                 "Hold up! Spare me that nonsense. It's dangerous. We're
  25.  *                  set up for direct current in America. People like it,
  26.  *                  and it's all I'll ever fool with. But maybe I could
  27.  *                  give you a job. Can you fix a ship's lighting plant?"
  28.  *                  Thomas Edison to Nikola Tesla, 1884.
  29.  */
  30.  
  31. /*
  32.  * Gray: (continued, but edited for current content)
  33.  *
  34.  * The nature of the terrain can be changed by playing with the numbers
  35.  * in 'Range'. If you change SIZE, you must also change the number of
  36.  * values given for 'Range'.  Also, if you use the graphics HIRES flag
  37.  * to get 640 pixel width screens, it is advisable to use numbers that
  38.  * are approximately half what give good results for 320 pixel width
  39.  * screens.  The way this is set up, the created terrain for SIZE = 8
  40.  * and XGEOM set to SINGLES is 256 pixels by 256 pixels, which doesn't
  41.  * fit on a non-interlaced screen.  Only the top 200 pixels are shown.
  42.  * The terrain is a torus, i.e. wraps around both horizontally as well as
  43.  * vertically.
  44.  *
  45.  * In this modified program, to see the whole torus in a rectangular
  46.  * format, use SIZE = 7 and set XGEOM to DOUBLES, YGEOM to SINGLES.
  47.  * For other combinations of SIZE, X and Y GEOM, Range, SCREEN_HEIGHT
  48.  * and SCREEN_WIDTH, DEPTH and ColourMap, see instructions
  49.  * below.  One of the more outrageous combinations, 256 wide by 400 high,
  50.  * (384 pixels plus 16 for terrain relief), with 16 colors, can be set up
  51.  * by using SIZE = 7, XGEOM = DOUBLES, YGEOM = TRIPLES, 7 value Range table,
  52.  * SCREEN_HEIGHT = 400,  SCREEN_WIDTH = 320, DEPTH = 4, use the sixteen
  53.  * element ColourMap, and set NewWindow flag = LACE.  This is also the
  54.  * fastest Devil's Post Pile configuration, since the posts are shorter.
  55.  * The disadvantage is that the scale of the terrain is smaller.
  56.  */
  57.  
  58. /*
  59.  * Gray goes on to add:
  60.  * Feel free to use this algorithm in any games you write, so long as you
  61.  * give me [Gray] credit for it. (I THINK I invented it, since I've never
  62.  * heard of anything similar, and other programs I've seen use much slower
  63.  * methods.)
  64.  */
  65.  
  66. /*
  67.  * Of course, by adding the 3d algorithm to Gray's code (that has a familiar
  68.  * ring, somehow) things did get somewhat slower, so it's a good thing that
  69.  * Gray decided to make the code fast!
  70.  */
  71.