home *** CD-ROM | disk | FTP | other *** search
/ TopWare 18: Liquid / Image.iso / liquid / top1151 / frct2pov.txt < prev    next >
Text File  |  1994-01-03  |  21KB  |  503 lines

  1.  
  2.                -=> Fractint to POV-Ray v0.5 <=-
  3.  
  4.                   -=> by David Grossman <=-
  5.  
  6.                         -=> 1/3/94 <=-
  7.  
  8.  
  9. Requires:
  10.  
  11.         Fractint v16 or later
  12.         POV-Ray 2.0 or later
  13.         Some familiarity with both
  14.  
  15. Introduction:
  16.  
  17.      Fractint to POV-Ray ( hereafter referred to as 'FRCT2POV' ) 
  18. reads a specified parameter set from a Fractint parameter file 
  19. and performs the required rotation and scaling in order to 
  20. reproduce the identical image in POV-Ray with the 'mandel' 
  21. pigment specification. This allows one to map a fractal 
  22. Mandelbrot image onto an object in POV-Ray without using an 
  23. image_map of a gif. The original Fractint Mandelbrot can be 
  24. unevenly scaled, rotated and skewed ( non-perpendicular edges ) 
  25. and FRCT2POV will still be able to convert it. FRCT2POV will also 
  26. attempt to convert the Fractint color map into a POV-Ray 
  27. compatible 'color_map'. 
  28.      There are a number of advantages to using the 'mandel' 
  29. texture instead of an image_mapped Fractint gif. One advantage is 
  30. that all detail in the Mandelbrot set is retained over all areas. 
  31. An 'image_map' of a Mandelbrot 'gif' obtained from Fractint will 
  32. be of inferior quality when mapped onto an object. Negligible 
  33. extra memory is needed to do a 'mandel' texture when compared to 
  34. the amounts required by a 'image_map', especially large images or 
  35. multiple images. Another advantage is the fact that the number of 
  36. times a color map is repeated can be modified in POV with the 
  37. frequency keyword whereas in Fractint this frequency is fixed. 
  38. The 32767 upper limit on the maximum number of iterations in 
  39. Fractint is not imposed in POV-Ray. ( This limit would only 
  40. affect the extremely 'deep' mandelbrots but in general is not 
  41. very important. ) True-color (24 bit) images with anti-aliasing 
  42. can also be obtained with POV-Ray. ( I am not sure how Fractint 
  43. works in true-color mode. ) Of course there are many 
  44. disadvantages to the POV-Ray 'mandel' texture compared with the 
  45. Fractint Mandelbrot. One important disadvantage is that POV-Ray 
  46. limits the number of entries in the 'color_map' to 20. This 
  47. doesn't mean you can only use 20 colors but that you can only 
  48. have 20 color 'nodes'. See the POV-Ray documentation on this 
  49. subject. Another disadvantage is that POV-Ray doesn't support any 
  50. of the 'goodies' that are included in Fractint. From all of the 
  51. 'basic options' that Fractint supports, only the maximum number 
  52. of iterations can be used. None of the 'extended options' are 
  53. supported. ( Color cycling is supported in a different manner. ) 
  54. None of the Mandelbrot 'parameters' are supported either. 
  55. Although this may seem very limiting, many of the 'Mandelbrot 
  56. set' images that are commonly seen are just basic Mandelbrots 
  57. with an interesting color map applied. There are infinite 
  58. possibilities for creating beautiful fractal textures. In POV-
  59. Ray, rendering time increases depending on the location in the 
  60. Mandelbrot set when using the 'mandel' texture. When using an 
  61. 'image_map', the set does not have to be calculated as it is 
  62. rendered. If you only want to do a planar Mandelbrot image, an 
  63. 'image_map' may still be the way to go. If you want a complex or 
  64. very large object to have a Mandelbrot texture, then a POV-Ray 
  65. 'mandel' pigment will be the best solution.
  66.  
  67. Notes on Fractint input files:
  68.  
  69.      FRCT2POV assumes that the specified parameter is a 
  70. Mandelbrot. ( It doesn't check. ) The only information that is 
  71. read from the parameter file is the parameter name, 'corners=', 
  72. 'maxiter=', 'colors='. This means that you can have an 
  73. interesting mandelbrot with all of the cool Fractint options such 
  74. as biomorph, decomposition, log palette, etc. and still be able 
  75. to convert the basic Mandelbrot to POV-Ray. ( The POV-Ray 
  76. Mandelbrot will not look exactly the same as the Fractint version 
  77. but it will represent the same location in the set. ) 
  78.      The color map can be specified in the parameter file as a 
  79. file name 'colors=@filename.map', it can be encoded, or it can be 
  80. specified on the command line.
  81.  
  82. Notes on color map conversion:
  83.  
  84.      Fractint to POV-Ray converts Fractint color maps by finding 
  85. the largest intervals that can be represented by a smooth color 
  86. transition between two fixed colors. These colors are then 
  87. assigned as POV-Ray color_map entries. Due to the fact that 
  88. Fractint color maps are rounded to the nearest factor of 4, the 
  89. conversion process is not perfect. It calculates the maximum 
  90. error that occurs when determining the smooth color transition 
  91. and if this error is less than a specified value, it saves the 
  92. endpoint colors as 'nodes' or color_map entries. This error 
  93. starts at the value specified by 'mm=' and is then increased 
  94. until the color map can be converted with less than or equal to 
  95. twenty entries. ( this limit is imposed by POV-Ray ) If the 
  96. maximum error is increased past a limiting value of 20 and the 
  97. color map entries exceed 20 ( no relation to the previous '20' ) 
  98. the color map is not written. If the error becomes too big then 
  99. the color_map will bear little resemblance to its original 
  100. Fractint map. The default starting value for the starting 
  101. 'maximum error' value is 4. Color maps that are converted at this 
  102. value are very accurate.
  103.  
  104. Notes on output files:
  105.  
  106.      FRCT2POV output files consist of a 'header' which states 
  107. which file, parameter, and color map was converted as well as the 
  108. '#declare'd names and '.inc' file name. The time and date that 
  109. the file was converted is also shown. ( File 'header' information 
  110. can be turned off if desired. ) By default, the POV 'color_map' 
  111. is embedded in the '#declare'd texture. ( The color_map can be 
  112. '#declared' and then used in the '#declare'd texture if desired. 
  113. ) The '#declare'd names can be specified or defaulted to the name 
  114. of the converted parameter and color map.
  115.      This version of FRCT2POV '#declare's the Mandelbrot as a 
  116. 'pigment' rather than a 'texture'. In the new POV ( 2.0 or later 
  117. ) 'pigment' implies 'texture'. In later versions of FRCT2POV, a 
  118. 'texture' may be '#declare'd with embedded 'normal', 'finish' and 
  119. additional transformation specifications.
  120.      The specified Mandelbrot set is first translated to the 
  121. origin. Then is rotated and scaled. ( If required )
  122.      Some rotated and skewed Mandelbrot sets require two sets of 
  123. rotations and scaling. In this case, the first rotation orients 
  124. the set to the optimum position to 'skew' the image with the 
  125. subsequent scaling. The image is then rotated and then scaled to 
  126. its final position. ( The fact that unskewed, rotated Mandelbrots 
  127. are still subjected to the unskewing rotation and scaling is due 
  128. to numerical inaccuracies when testing for perpendicular axes. 
  129. This problem will be fixed in the next version. )
  130.      By default, the Mandelbrot image is scaled to fit the area 
  131. bounded by the lines x= +/-1 and y= +/-0.75 . This allows you to 
  132. scale the texture accurately. ( Note that this window aspect 
  133. ratio is the same as the most common video modes used in Fractint 
  134. and POV-Ray )
  135.  
  136. Installation:
  137.  
  138.      Please see the file INSTALL.TXT for installation 
  139. instructions.    
  140.  
  141. Fractint to POV-Ray file list:
  142.  
  143.      Please see the file FILELIST.TXT for information on the 
  144. Fractint to POV-Ray package files.
  145.  
  146. Operation:
  147.  
  148.      FRCT2POV is operated from the command line. Like POV-Ray, 
  149. parameters are read first from an initialization file and then 
  150. from the command line. An additional initialization file may be 
  151. specified on the command line and will be read after the default 
  152. ini file and before the command line parameters. ( only one 
  153. additional '.ini' file is supported in this version. )
  154.  
  155. Sample Scenes:
  156.  
  157.      There are a number of sample scenes included under the names 
  158. 'f2pscn?.pov'. The first sample scene 'f2pscn0.pov' is just a 2-D 
  159. representation of the specified Mandelbrot that is viewed in such 
  160. a way that it recreates the identical image from Fractint. See 
  161. the file 'filelist.txt' file for more information on the other 
  162. scenes.
  163.      These scenes '#include' the file 'frct2pov.inc' and use the 
  164. name frct2pov for the texture name. When you convert a fractal 
  165. with Fractint to POV-Ray, the program outputs the 'frct2pov.inc' 
  166. file. ( unless you tell it not to ) This file '#include's the 
  167. output file you just converted and re'#declare's the texture name 
  168. of that texture. All you have to do to trace a test scene is to 
  169. convert a parameter and then trace the scene. No editing is 
  170. required. You can always edit the 'frct2pov.inc' file to specify 
  171. a previously created texture.
  172.  
  173. Procedure:
  174.  
  175.      The first step in creating a Mandelbrot texture in POV-Ray 
  176. is to run Fractint, create a Mandelbrot image with the desired 
  177. color map. ( see the Fractint documentation on these subjects ) 
  178. Then save it to a parameter file by using the 'B' key. Specify a 
  179. parameter file to hold your Mandelbrots and use the same 
  180. parameter file for all of your FRCT2POV conversions. ( You can 
  181. have multiple images in a parameter file. ) You can specify your 
  182. parameter file in the FRCT2POV '.ini' files so you do not have to 
  183. enter it in at the command line. In the 'save colors?' section 
  184. you can enter 'y' to save your current color map, or specify a 
  185. file name. These are the only necessary parameters. Note that any 
  186. color map specified on the command line will override the color 
  187. map specified in the parameter.
  188.       The next step is to run 'FRCT2POV.EXE' with the correct 
  189. command line parameters. ( See the following discussion on 
  190. command line parameters. )
  191.     The final step is to '#include' the outputted file into 
  192. whatever scene file you want to use it in and specify the 
  193. '#declare'd texture name in your object's texture statement. You 
  194. can add 'normal' and 'finish' statements to the texture 
  195. statements. You can also trace any of the sample scenes without 
  196. any editing.
  197.  
  198. IMPORTANT NOTE!
  199.  
  200.     FRCT2POV and POV-Ray do not check to see if they are 
  201. overwriting an output file. If you want to save a previously 
  202. created scene or texture you must specify different output file 
  203. names on the FRCT2POV and POV-Ray command lines or rename the 
  204. previously created output files.
  205.  
  206. Quick reference:
  207.  
  208.      See the file 'frct2pov.ini' for a quick reference to all 
  209. FRCT2POV parameters.
  210.  
  211. Parameter Syntax:
  212.  
  213.     All parameters must be specified in the form 'xx=parameter'. 
  214. On the command line they are separated by spaces. e.g.
  215.  
  216. frct2pov pf=fractals.par pn=mymandel ce=y ff=3 do=n
  217.  
  218.     In the '.INI' files, each parameter must begin on a new line 
  219. with no leading spaces. Everything after the first space 
  220. encountered is ignored.
  221.  
  222. IMPORTANT NOTE!
  223.  
  224.      FRCT2POV only looks for parameters it understands and 
  225. ignores everything else. If you misspell a parameter 
  226. specification prefix ( 'ff=' ), FRCT2POV will not notify you of 
  227. the error but will ignore it. ( Future versions will notify you 
  228. of these errors. ) This is why you can have all sorts of extra 
  229. baggage in the '.ini' file without causing an error.
  230.  
  231.     Flag parameters ( on/off only ) are specified with a 'y' or 
  232. a '1' for on and a 'n' or a '0' for off 'yes' and 'no' are also 
  233. acceptable ( FRCT2POV only looks at the first letter ).
  234.  
  235. Parameters: ( shown with defaults )
  236.  
  237. //      input parameters
  238.  
  239. in=none     INitialization file name
  240.  
  241.    This parameter is only used from the command line. It 
  242. specifies a second initialization file that is to be read after 
  243. the default 'frct2pov.ini' file. This can be used to specify 
  244. parameters for a frct2pov parameter set. ( Note that since this 
  245. file is read after the 'frct2pov.ini' file, only parameters that 
  246. need to be changed should be included in this file. )
  247.  
  248. //      input/output paths
  249.      
  250. fp=c:\fractint    Fractint Path
  251.  
  252.    specifies the path to the Fractint .par and .map files.
  253.    
  254. pp=c:\povray     Pov-ray Path
  255.  
  256.    specifies the path to the location of .inc file output.
  257.  
  258. //      Fractint input parameters
  259.    
  260. pf=f2p.par     Parameter File name   ( filename.par )
  261.  
  262.    specifies the name of the Fractint parameter file. 
  263.  
  264. pn=f2p01    Parameter Name     ( alphanumeric with no spaces )
  265.  
  266.    specifies the name of the parameter in the specified '.par' 
  267. file that is to be converted.
  268.  
  269. cf=none     Color map File name  ( filename.map )
  270.  
  271.    specifies the name of the Fractint color map ( '.map' ) file 
  272. that is to be converted. If this parameter is 'none' or is blank, 
  273. the color map file name is as specified in the parameter text. If 
  274. no color map is specified in the parameter text and is not 
  275. specified on the command line then no color map is output.
  276.  
  277. //      POV-Ray output parameters
  278.  
  279. ti=none     Texture Include file name  ( filename.inc / .??? )
  280.  
  281.    specifies the name of the '.inc' texture file that is to be 
  282. output. If this parameter is 'none' or is blank then the texture 
  283. include filename is taken from the first 8 characters of the 
  284. parameter name. Be careful to take this into consideration when 
  285. creating output files! The parameter names 'mymandel1' and 
  286. 'mymandel2' will output the same texture file 'mymandel.inc'.
  287.  
  288. tn=none     Texture Name    ( alphanumeric with no spaces )
  289.  
  290.    specifies the name of the '#declare'd texture. If this 
  291. parameter is 'none' or is not specified it defaults to the name 
  292. of the converted parameter. Since Fractint allows parameters to 
  293. begin with numbers and POV-Ray doesn't, names that begin with 
  294. numbers are prefixed with 't_'.
  295.  
  296. cn=none     Color map Name    ( alphanumeric with no spaces )
  297.  
  298.    specifies the name of the '#declare'd color map. If this 
  299. parameter 'none' or is not specified it defaults to the name of 
  300. the converted color map. Since Fractint allows parameters to 
  301. begin with numbers and POV-Ray doesn't, names that begin with 
  302. numbers are prefixed with 'c_'. If the color map name is the same 
  303. as the parameter name then it is prefixed with 'c_'.
  304.  
  305. //      output options
  306.  
  307. wt=yes     Write Test include file   ( yes/no )
  308.  
  309.    specifies whether the 'frct2pov.inc' file is written.
  310.  
  311. ih=yes     Include Header  ( yes/no )       
  312.  
  313.    specifies whether the header conversion information is written 
  314. to the texture include file.
  315.  
  316. ce=yes     Color map Embed   ( yes/no )
  317.  
  318.    specifies whether the color map is written directly into the 
  319. Mandelbrot 'pigment' instead of declared. ( prevents errors if 
  320. multiple color maps are declared in the same '.pov' or '.inc' 
  321. file.
  322.  
  323. ta=no     Texture include Append   ( yes/no )
  324.  
  325.    specifies whether the texture '.inc' file is appended to an 
  326. existing file. ( allows you to make libraries of mandelbrot 
  327. textures similar to 'textures.inc' and 'stones.inc'. ( Remember 
  328. that all '#declare'd names must be unique. )
  329.  
  330. do=yes     Display Output   ( yes/no )
  331.  
  332.    specifies whether the outputted file is displayed after it is 
  333. written. ( implemented as a dos 'type filename.inc | more' 
  334. command )
  335.  
  336. ab=yes     display About information     ( yes/no )
  337.  
  338.    You can disable the output of the Fractint to POV-Ray 
  339. 'about' information. This information is only outputted to the 
  340. screen and not to any files.
  341.  
  342. mm=4     Maximum Error start value  ( 2, 19 )
  343.  
  344.    specifies the minimum starting value for the tolerance in 
  345. color map conversion. ( see the 'Notes on color map conversion' )
  346.  
  347. //    texture options
  348.  
  349. mi=0    Maximum number of Iterations ( integer > 0 | 0 for none )
  350.  
  351.    specifies the maximum number of iterations that are performed 
  352. in creating the Mandelbrot texture. If this parameter is '0' or 
  353. unspecified its value is taken from the parameter text. If it is 
  354. not specified in the parameter text it is given a default value 
  355. of 32640.( see the Fractint documentation for more information on 
  356. this topic )
  357.  
  358. ff=1     Frequency Factor      ( nonzero )
  359.  
  360.    specifies a multiplication factor that is written to the POV-
  361. Ray 'frequency' specification. This adjusts the number of times 
  362. the color map is repeated. The default frequency that is output 
  363. is calculated to duplicate the color distribution in the original 
  364. Fractint image. In POV-Ray, this distribution can be changed 
  365. whereas in Fractint it cannot. ( except in different ways such as 
  366. with a logarithmic palette which is not possible in POV-Ray )( 
  367. see the POV-Ray documentation for more information on this topic 
  368. )
  369.  
  370. ph=0     PHase      (  >=0 & <=1  )
  371.  
  372.    specifies the starting point of the POV-Ray color map. 
  373. Effectively duplicating the ability to 'cycle' the POV-Ray color 
  374. map as can be done in Fractint ( see the Fractint documentation 
  375. for the topic of color cycling and the POV-Ray documentation for 
  376. the topic of 'phase' )
  377.  
  378. xw=2      X-Window size     (  real >0 )
  379. yw=1.5    Y-Window size     (  real >0 )
  380.  
  381.    specifies the horizontal and vertical size of the output 
  382. texture in POV-Ray space. The window specified by the X and Y-
  383. Window sizes determine the region in which the specified 
  384. Mandelbrot resides. The ratio of X-Window to Y-Window should be 
  385. the same as the aspect ratio of the video mode in which the 
  386. Mandelbrot was created in Fractint for the image to be converted 
  387. accurately. ( for most video modes this ratio is 4/3 ) ( Note 
  388. that the Mandelbrot texture extends infinitely beyond this window 
  389. size. )
  390.  
  391.  
  392. //      manual parameter input
  393.  
  394. Manual parameter input allows you to create a Mandelbrot texture 
  395. include file without a Fractint parameter file. However, you must 
  396. specify a Color map File name ( cf= ) in order to output a color 
  397. map. In order to use manual parameter input, either WIdth or 
  398. Magnification must be specified. 
  399.  
  400. xc= X-Center     ( real )
  401. yc= Y-Center     ( real )
  402.  
  403.    specifies the where the center of the Mandelbrot texture is 
  404. located in Mandelbrot space. Many books provide center/width 
  405. information about their Mandelbrot images. ( only used with WIdth 
  406. and MaGnification )( note that only values within the proximity 
  407. of the actual Mandelbrot set produce interesting results )
  408.  
  409. wi= WIdth     ( real )
  410.  
  411.    specifies the width of the desired Mandelbrot in Mandelbrot 
  412. space.
  413.  
  414. mg= MaGnification   ( real )
  415.  
  416.    specifies the magnification of the desired Mandelbrot in 
  417. Mandelbrot space. ( this specification overrides WIdth if both 
  418. are given )
  419.  
  420.  
  421. Coming soon:
  422.  
  423. ( may be included in later versions depending on user response )
  424.  
  425. provisions for POV-Ray 'filter' specs
  426. less restrictive file name specs
  427. multiple .ini files may be specified
  428. ability to pass on parameter comments to the '.inc' file header
  429.  
  430. or= ORientation      image aligned with specified axes.
  431.  
  432. xtl= X-Top-Left      for manual input ( not really necessary )
  433. ytl= Y-Top-Left
  434. xbr= X-Bottom-Right
  435. ybr= Y-Bottom-Right
  436. xbl= X-Bottom-Left
  437. ybl= Y-Bottom-Left
  438.  
  439. ca= Color map include Append      
  440. mo= Mandelbrot Only
  441. co= Color map Only
  442. ci= Color map Include filename
  443.  
  444. embedable texture and transformation specs:
  445.  
  446. finish {}
  447. normal {}
  448. scale <>
  449. rotate <>
  450. translate <>
  451. #include "colormap.inc" 
  452. //  user specifiable comment lines in texture
  453.  
  454. Other texture types may be included in the package.
  455.  
  456. Starfield textures ( with options )
  457. Cloud textures  ( with options )
  458.  
  459.  
  460. Fractint to POV-Ray history:
  461.  
  462. v0.5      First and possibly only version.
  463.  
  464.  
  465. Legal information:
  466.  
  467.      Please see the file 'f2plegal.txt' for this information.
  468.  
  469.  
  470. Thanks to:
  471.  
  472. The creators of POV-Ray and Fractint for their fantastic 
  473. programs.
  474.  
  475.  
  476. Distribution information:
  477.  
  478.      Although I am distributing this program as 'free-ware', I am 
  479. asking for a small donation as I have spent a lot of extra time 
  480. creating sample parameters, scene files, and documentation. I 
  481. have also incorporated many features that were originally planned 
  482. for later versions. If you find this program useful I would 
  483. appreciate it if you would send me five or ten dollars ( or more 
  484. if you want ). Instead of or in addition to money, I would also 
  485. like to see your raytraces. You could send them to me in the mail 
  486. or upload them to the raytracing BBS 'You Can Call Me Ray' or to 
  487. America Online.
  488.  
  489.     You can reach me on America Online as DavidG6784, on Internet 
  490. as DavidG6784@aol.com or on 'You Can Call Me Ray' as Dave 
  491. Grossman. See the POV-Ray documentation for information on the 
  492. YCCMR BBS. All questions will be answered promptly and any 
  493. comments would be appreciated.
  494.  
  495.     If you decide to send a donation and/or copies of your work  
  496. ( 3.5" 1.44M media is preferred ), my address is:
  497.  
  498.      David Grossman
  499.      2516 Prairie Ave #1C
  500.      Evanston, Il. 60201-2285
  501.  
  502.  
  503.