home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / NETWORK / netpbm_docs.lzh / NETPBM / DOCS / ppmforge.1 < prev    next >
Text File  |  1996-11-18  |  15KB  |  406 lines

  1. .TH ppmforge 1 "25 October 1991"
  2. .IX ppmforge
  3. .IX fractals
  4. .IX clouds
  5. .IX planets
  6. .IX stars
  7. .SH NAME
  8. ppmforge - fractal forgeries of clouds, planets, and starry skies
  9. .SH SYNOPSIS
  10. .na
  11. .nh
  12. .B ppmforge
  13. .RB [ -clouds ]
  14. 'in +9n
  15. .RB [ -night ]
  16. .RB [ -dimension
  17. .IR  dimen ]
  18. .RB [ -hour
  19. .IR hour ]
  20. .RB [ -inclination|-tilt
  21. .IR angle ]
  22. .RB [ -mesh
  23. .IR size ]
  24. .RB [ -power
  25. .IR factor ]
  26. .RB [ -glaciers
  27. .IR level ]
  28. .RB [ -ice
  29. .IR level ]
  30. .RB [ -saturation
  31. .IR sat ]
  32. .RB [ -seed
  33. .IR seed ]
  34. .RB [ -stars
  35. .IR fraction ]
  36. .RB [ -xsize|-width
  37. .IR width ]
  38. .RB [ -ysize|-height
  39. .IR height ]
  40. .in -9n
  41. .ad
  42. .hy
  43. .SH DESCRIPTION
  44. .B ppmforge
  45. generates three kinds of ``random fractal forgeries,'' the term coined
  46. by Richard F. Voss of the IBM Thomas J. Watson Research Center for
  47. seemingly realistic pictures of natural objects generated by simple
  48. algorithms embodying randomness and fractal self-similarity.  The
  49. techniques used by
  50. .B ppmforge
  51. are essentially those
  52. given by Voss[1], particularly the technique of spectral synthesis
  53. explained in more detail by Dietmar Saupe[2].
  54. .PP
  55. The program generates two varieties of pictures: planets and clouds,
  56. which are just different renderings of data generated in an identical
  57. manner, illustrating the unity of the fractal structure of these very
  58. different objects.  A third type of picture, a starry sky, is
  59. synthesised directly from pseudorandom numbers.
  60. .PP
  61. The generation of planets or clouds begins with the preparation of an
  62. array of random data in the frequency domain.  The size of this
  63. array, the ``mesh size,'' can be set with the
  64. .B -mesh
  65. option; the larger the mesh the more realistic the pictures but the
  66. calculation time and memory requirement increases as the square of the
  67. mesh size.  The fractal dimension, which you can specify with the
  68. .B -dimension
  69. option, determines the roughness of the terrain on the planet or the
  70. scale of detail in the clouds.  As the fractal dimension is increased,
  71. more high frequency components are added into the random mesh.
  72. .PP
  73. Once the mesh is generated, an inverse two dimensional Fourier
  74. transform is performed upon it.  This converts the original random
  75. frequency domain data into spatial amplitudes.  We scale the real
  76. components that result from the Fourier transform into numbers from 0
  77. to 1 associated with each point on the mesh.  You can further
  78. modify this number by applying a ``power law scale'' to it with the
  79. .B -power
  80. option.   Unity scale
  81. leaves the numbers unmodified; a power scale of 0.5 takes the square
  82. root of the numbers in the mesh, while a power scale of 3 replaces the
  83. numbers in the mesh with their cubes.  Power law scaling is best
  84. envisioned by thinking of the data as representing the elevation of
  85. terrain; powers less than 1 yield landscapes with vertical scarps that
  86. look like glacially-carved valleys; powers greater than one make
  87. fairy-castle spires (which require large mesh sizes and high
  88. resolution for best results).
  89. .PP
  90. After these calculations, we have a array of the specified size
  91. containing numbers that range from 0 to 1.  The pixmaps are generated as
  92. follows:
  93. .TP 10
  94. .B Clouds
  95. A colour map is created that ranges from pure blue to white by
  96. increasing admixture (desaturation) of blue with white.  Numbers less
  97. than 0.5 are coloured blue, numbers between 0.5 and 1.0 are coloured
  98. with corresponding levels of white, with 1.0 being pure white.
  99. .TP
  100. .B Planet
  101. The mesh is projected onto a sphere.  Values less than 0.5 are treated
  102. as water and values between 0.5 and 1.0 as land.  The water areas are
  103. coloured based upon the water depth, and land based on its elevation.
  104. The random depth data are used to create clouds over the oceans.  An
  105. atmosphere approximately like the Earth's is simulated; its light
  106. absorption is calculated to create a blue cast around the limb of the
  107. planet.  A function that rises from 0 to 1 based on latitude is
  108. modulated by the local elevation to generate polar ice caps--high
  109. altitude terrain carries glaciers farther from the pole.  Based on the
  110. position of the star with respect to the observer, the apparent colour
  111. of each pixel of the planet is calculated by ray-tracing from the star
  112. to the planet to the observer and applying a lighting model that sums
  113. ambient light and diffuse reflection (for most planets ambient light
  114. is zero, as their primary star is the only source of illumination).
  115. Additional random data are used to generate stars around the planet.
  116. .TP
  117. .B Night
  118. A sequence of pseudorandom numbers is used to generate stars with a
  119. user specified density.
  120. .PP
  121. Cloud pictures always contain 256 or fewer colours and may be
  122. displayed on most colour mapped devices without further processing.
  123. Planet pictures often contain tens of thousands of colours which
  124. must be compressed with
  125. .B ppmquant
  126. or
  127. .B ppmdither
  128. before encoding in a colour mapped format.  If the display resolution is
  129. high enough,
  130. .B ppmdither
  131. generally produces better looking planets.
  132. .B ppmquant
  133. tends to create discrete colour bands, particularly in the oceans,
  134. which are unrealistic and distracting.  The number of colours in starry
  135. sky pictures generated with the
  136. .B -night
  137. option depends on the value specified for
  138. .BR -saturation .
  139. Small values limit the colour temperature distribution of the stars
  140. and reduce the number of colours in the image.
  141. If the
  142. .B -saturation
  143. is set to 0, none of the stars will be coloured and the resulting
  144. image will never contain more than 256 colours.
  145. Night sky pictures with many different star colours often look
  146. best when colour compressed by
  147. .B pnmdepth
  148. rather than
  149. .B ppmquant
  150. or
  151. .BR ppmdither .
  152. Try
  153. .I newmaxval
  154. settings of 63, 31, or 15 with
  155. .B pnmdepth
  156. to reduce the number of colours in the picture to 256 or fewer.
  157. .SH OPTIONS
  158. .TP 10
  159. .B -clouds
  160. Generate clouds.  A pixmap of fractal clouds is generated.  Selecting clouds
  161. sets the default for fractal dimension to 2.15 and power scale factor
  162. to 0.75.
  163. .TP
  164. .BI -dimension " dimen"
  165. Sets the fractal dimension to the specified
  166. .IR dimen ,
  167. which may be any floating point value between 0 and 3.  Higher fractal
  168. dimensions create more ``chaotic'' images, which require higher
  169. resolution output and a larger FFT mesh size to look good.  If no
  170. dimension is specified, 2.4 is used when generating planets and 2.15
  171. for clouds.
  172. .TP
  173. .BI -glaciers " level"
  174. The floating point
  175. .I level
  176. setting controls the extent to which terrain elevation causes ice to
  177. appear at lower latitudes.  The default value of 0.75 makes the polar
  178. caps extend toward the equator across high terrain and forms glaciers
  179. in the highest mountains, as on Earth.  Higher values make ice sheets
  180. that cover more and more of the land surface, simulating planets in the
  181. midst of an ice age.  Lower values tend to be boring, resulting in
  182. unrealistic geometrically-precise ice cap boundaries.
  183. .TP
  184. .BI -hour " hour"
  185. When generating a planet,
  186. .I hour
  187. is used as the ``hour angle at the central meridian.''  If you specify
  188. .BR "-hour 12" ,
  189. for example, the planet will be fully illuminated, corresponding to
  190. high noon at the longitude at the centre of the screen.  You can
  191. specify any floating point value between 0 and 24 for
  192. .IR hour ,
  193. but values which place most of the planet in darkness (0 to 4 and 20
  194. to 24) result in crescents which, while pretty, don't give you many
  195. illuminated pixels for the amount of computing that's required.  If no
  196. .B -hour
  197. option is specified, a random hour angle is chosen, biased so that
  198. only 25% of the images generated will be crescents.
  199. .TP
  200. .BI -ice " level"
  201. Sets the extent of the polar ice caps to the given floating point
  202. .IR level .
  203. The default level of 0.4 produces ice caps similar to those of the Earth.
  204. Smaller values reduce the amount of ice, while larger
  205. .B -ice
  206. settings create more prominent ice caps.  Sufficiently large values,
  207. such as 100 or more, in conjunction with small settings for
  208. .B -glaciers
  209. (try 0.1) create ``ice balls'' like Europa.
  210. .TP
  211. .BI -inclination|-tilt " angle"
  212. The inclination angle of the planet with regard to its primary star is
  213. set to
  214. .IR angle ,
  215. which can be any floating point value from -90 to 90.  The inclination
  216. angle can be thought of as specifying, in degrees, the ``season'' the
  217. planet is presently experiencing or, more precisely, the latitude at
  218. which the star transits the zenith at local noon.  If 0, the planet
  219. is at equinox; the star is directly overhead at the equator.
  220. Positive values represent summer in the northern hemisphere, negative
  221. values summer in the southern hemisphere.  The Earth's inclination
  222. angle, for example, is about 23.5 at the June solstice, 0 at the
  223. equinoxes in March and September, and -23.5 at the December solstice.
  224. If no inclination angle is specified, a random value between -21.6 and
  225. 21.6 degrees is chosen.
  226. .TP
  227. .BI -mesh " size"
  228. A mesh of
  229. .IR size " by " size
  230. will be used for the fast Fourier transform (FFT).  Note that memory
  231. requirements and computation speed increase as the square of
  232. .IR size ;
  233. if you double the mesh size, the program will use four times the
  234. memory and run four times as long.  The default mesh is 256x256, which
  235. produces reasonably good looking pictures while using half a megabyte
  236. for the 256x256 array of single precision complex numbers
  237. required by the FFT.  On machines with limited memory capacity, you
  238. may have to reduce the mesh size to avoid running out of RAM.
  239. Increasing the mesh size produces better looking pictures; the
  240. difference becomes particularly noticeable when generating high
  241. resolution images with relatively high fractal dimensions (between 2.2
  242. and 3).
  243. .TP
  244. .B -night
  245. A starry sky is generated.  The stars are created by the same algorithm
  246. used for the stars that surround planet pictures, but the output
  247. consists exclusively of stars.
  248. .TP
  249. .BI -power " factor"
  250. Sets the ``power factor'' used to scale elevations synthesised from
  251. the FFT to
  252. .IR factor ,
  253. which can be any floating point number greater than zero.  If no
  254. factor is specified a default of 1.2 is used if a planet is being
  255. generated, or 0.75 if clouds are selected by the
  256. .B -clouds
  257. option.  The result of the FFT image synthesis is an array of elevation
  258. values between 0 and 1.  A non-unity power factor exponentiates each
  259. of these elevations to the specified power.  For example, a power
  260. factor of 2 squares each value, while a power factor of 0.5 replaces
  261. each with its square root.  (Note that exponentiating values between 0
  262. and 1 yields values that remain within that range.)  Power factors
  263. less than 1 emphasise large-scale elevation changes at the expense of
  264. small variations.  Power factors greater than 1 increase the roughness
  265. of the terrain and, like high fractal dimensions, may require a larger
  266. FFT mesh size and/or higher screen resolution to look good.
  267. .TP
  268. .BI -saturation " sat"
  269. Controls the degree of colour saturation of the stars that surround planet
  270. pictures and fill starry skies created with the
  271. .B -night
  272. option.  The default value of 125 creates stars which resemble the sky
  273. as seen by the human eye from Earth's surface.  Stars are dim; only
  274. the brightest activate the cones in the human retina, causing colour
  275. to be perceived.  Higher values of
  276. .I sat
  277. approximate the appearance of stars from Earth orbit, where better
  278. dark adaptation, absence of skyglow, and the concentration of light
  279. from a given star onto a smaller area of the retina thanks to the lack
  280. of atmospheric turbulence enhances the perception of colour.  Values
  281. greater than 250 create ``science fiction'' skies that, while pretty,
  282. don't occur in this universe.
  283. .TP
  284. Thanks to the inverse square law combined with Nature's love of
  285. mediocrity, there are many, many dim stars for every bright one.
  286. This population relationship is accurately reflected in the skies
  287. created by
  288. .BR ppmforge .
  289. Dim, low mass stars live much longer than bright massive stars,
  290. consequently there are many reddish stars for every blue giant.  This
  291. relationship is preserved by
  292. .BR ppmforge .
  293. You can reverse the proportion, simulating the sky as seen in a starburst
  294. galaxy, by specifying a negative
  295. .I sat
  296. value.
  297. .TP
  298. .BI -seed " num"
  299. Sets the seed for the random number generator to the integer
  300. .IR num .
  301. The seed used to create each picture is displayed on standard output (unless
  302. suppressed with the
  303. .B -quiet
  304. option).  Pictures generated with the same seed will be identical.  If no
  305. .B -seed
  306. is specified, a random seed derived from the date and time will be
  307. chosen.  Specifying an explicit seed allows you to re-render a picture
  308. you particularly like at a higher resolution or with different viewing
  309. parameters.
  310. .TP
  311. .BI -stars " fraction"
  312. Specifies the percentage of pixels, in tenths of a percent, which will
  313. appear as stars, either surrounding a planet or filling the entire
  314. frame if
  315. .B -night
  316. is specified.  The default
  317. .I fraction
  318. is 100.
  319. .TP
  320. .BI -xsize|-width " width"
  321. Sets the width of the generated image to
  322. .I width
  323. pixels.  The default width is 256 pixels.  Images must be at least as
  324. wide as they are high; if a width less than the height is specified,
  325. it will be increased to equal the height.  If you must have a long
  326. skinny pixmap, make a square one with
  327. .BR ppmforge ,
  328. then use
  329. .B pnmcut
  330. to extract a portion of the shape and size you require.
  331. .TP
  332. .BI -ysize|-height " height"
  333. Sets the height of the generated image to
  334. .I height
  335. pixels.  The default height is 256 pixels.  If the height specified
  336. exceeds the width, the width will be increased to equal the height.
  337. .PP
  338. All flags can be abbreviated to their shortest unique prefix.
  339. .SH BUGS
  340. .PP
  341. The algorithms require the output pixmap to be at least as wide as it
  342. is high, and the width to be an even number of pixels.  These
  343. constraints are enforced by increasing the size of the requested
  344. pixmap if necessary.
  345. .PP
  346. You may have to reduce the FFT mesh size on machines with 16 bit
  347. integers and segmented pointer architectures.
  348. .SH "SEE ALSO"
  349. .PD
  350. .BR pnmcut (1),
  351. .BR pnmdepth (1),
  352. .BR ppmdither (1),
  353. .BR ppmquant (1),
  354. .BR ppm (5)
  355. .TP 5
  356. [1] 
  357. Voss, Richard F., ``Random Fractal Forgeries,'' in Earnshaw
  358. et. al., Fundamental Algorithms for Computer Graphics, Berlin:
  359. Springer-Verlag, 1985.
  360. .TP
  361. [2]
  362. Peitgen, H.-O., and Saupe, D. eds., The Science Of Fractal Images,
  363. New York: Springer Verlag, 1988.
  364. .ne 10
  365. .SH AUTHOR
  366. .RS 5
  367. .nf
  368. John Walker
  369. Autodesk SA
  370. Avenue des Champs-Montants 14b
  371. CH-2074 MARIN
  372. Suisse/Schweiz/Svizzera/Svizra/Switzerland
  373. .PD 0
  374. .TP 9
  375. Usenet:
  376. kelvin@Autodesk.com
  377. .TP
  378. Fax:
  379. 038/33 88 15
  380. .TP
  381. Voice:
  382. 038/33 76 33
  383. .fi
  384. .RE
  385. .PD
  386. .PP
  387. Permission to use, copy, modify, and distribute this software and its
  388. documentation for any purpose and without fee is hereby granted,
  389. without any conditions or restrictions.  This software is provided ``as
  390. is'' without express or implied warranty.
  391. .PP
  392. .B PLUGWARE!
  393. If you like this kind of stuff, you may also enjoy ``James Gleick's
  394. Chaos--The Software'' for MS-DOS, available for $59.95 from your
  395. local software store or directly from Autodesk, Inc., Attn: Science
  396. Series, 2320 Marinship Way, Sausalito, CA 94965, USA.  Telephone:
  397. (800) 688-2344 toll-free or, outside the U.S. (415) 332-2344 Ext
  398. 4886.  Fax: (415) 289-4718.  ``Chaos--The Software'' includes a more
  399. comprehensive fractal forgery generator which creates
  400. three-dimensional landscapes as well as clouds and planets, plus five
  401. more modules which explore other aspects of Chaos.  The user guide of
  402. more than 200 pages includes an introduction by James Gleick and
  403. detailed explanations by Rudy Rucker of the mathematics and algorithms
  404. used by each program.
  405.