home *** CD-ROM | disk | FTP | other *** search
/ Ray Tracing Box / RAY_CD.mdf / RAYTRACE / _POV_DAT / NBGLAS / NBMARB.POV < prev   
Encoding:
Text File  |  1994-04-08  |  4.1 KB  |  251 lines

  1. /*
  2. Configrable marble textures by Norm Bowler
  3.  
  4. This marble texture hase 4 zones:
  5.  
  6. 1   Base color only  0 - MfLo
  7. 2   Blend from base to fade color  MfLo - MfHi
  8. 3   Blend from fade to vein color  MfHi - .95
  9. 4   Vein color only  .95 - 1
  10.  
  11. You can declare Mbase, Mfade and Mvein to set
  12. marble colors.  Additionaly, you can declare
  13. MfLo and MfHi to adjust the bandwidth of the
  14. fade color.
  15.  
  16. MfLo can have a value from 0 to MfHi
  17. MfHi can have a value form MfLo to .95
  18.  
  19. Increasing MfLo increases area of base color only.
  20. Decreasing MfHi increases width of vein.
  21.  
  22. */
  23.  
  24. //////////////////////
  25. // Textures
  26. //////////////////////
  27.  
  28. #include "colors.inc"
  29. #include "textures.inc"
  30.  
  31. //#1: White / Black
  32. #declare Mbase = color Gray95
  33. #declare Mfade = color Gray65
  34. #declare Mvein = color Gray10
  35. //my idea of "standard" values
  36. #declare MfLo  = .2   //low boundary of fade
  37. #declare MfHi  = .85  //high boundary of fade
  38.  
  39. #declare NBmarble=
  40. texture {
  41.    pigment {marble
  42.       turbulence 1.15
  43.       color_map{
  44.          [0   color Mbase]
  45.          [MfLo  color Mbase]
  46.          [MfHi color Mfade]
  47.          [.95 color Mvein]
  48.          [1   color Mvein]
  49.       }
  50.       rotate <57,33,-19>
  51.    }
  52.    finish {Shiny
  53.     reflection .2
  54.    }
  55. }
  56.  
  57.  
  58.  
  59. //#2: White / Dk Blue
  60. #declare Mbase = color Quartz
  61. #declare Mfade = color LightSteelBlue
  62. #declare Mvein = color MidnightBlue
  63. //not much base, thick vein
  64. #declare MfLo  = .05   
  65. #declare MfHi  = .75
  66.  
  67. #declare NBmarble2=
  68. texture {NBmarble
  69.   pigment{
  70.      color_map{
  71.          [0   color Mbase]
  72.          [MfLo  color Mbase]
  73.          [MfHi color Mfade]
  74.          [.95 color Mvein]
  75.          [1   color Mvein]
  76.       }
  77.   }
  78. }
  79.  
  80.  
  81.  
  82. //#3: Wheat / Green
  83. #declare Mbase = color Wheat
  84. #declare Mfade = color red .4 green .5 blue .45
  85. #declare Mvein = color HuntersGreen
  86. //not much base, thin vein
  87. #declare MfLo  = .05   
  88. #declare MfHi  = .92  
  89.  
  90. #declare NBmarble3=
  91. texture {NBmarble
  92.   pigment{
  93.      color_map{
  94.          [0   color Mbase]
  95.          [MfLo  color Mbase]
  96.          [MfHi color Mfade]
  97.          [.95 color Mvein]
  98.          [1   color Mvein]
  99.       }
  100.   }
  101. }
  102.  
  103.  
  104.  
  105. //#4: White / Red
  106. #declare Mbase = color Quartz
  107. #declare Mfade = color red .8 blue .65 green .55
  108. #declare Mvein = color red .33 green .1
  109. //lots of base, very thick vein
  110. #declare MfLo  = .5
  111. #declare MfHi  = .65  
  112.  
  113. #declare NBmarble4=
  114. texture {NBmarble
  115.   pigment{
  116.      color_map{
  117.          [0   color Mbase]
  118.          [MfLo  color Mbase]
  119.          [MfHi color Mfade]
  120.          [.95 color Mvein]
  121.          [1   color Mvein]
  122.       }
  123.   }
  124. }
  125.  
  126.  
  127.  
  128. //#5: Black / Gold
  129. #declare Mbase = color Gray10
  130. #declare Mfade = color red .5 green .5 blue .05
  131. #declare Mvein = color BrightGold
  132. //lots of base, very thin vein
  133. #declare MfLo  = .8
  134. #declare MfHi  = .94  
  135.  
  136. #declare NBmarble5=
  137. texture {NBmarble
  138.   pigment{
  139.      color_map{
  140.          [0   color Mbase]
  141.          [MfLo  color Mbase]
  142.          [MfHi color Mfade]
  143.          [.95 color Mvein]
  144.          [1   color Mvein]
  145.       }
  146.   }
  147. }
  148.  
  149.  
  150.  
  151. //////////////////////
  152. // Setup
  153. //////////////////////
  154.  
  155. #declare Cht=(3)
  156.  
  157. camera {
  158.    location  <0, Cht+2,-3>
  159.    direction <0, 0,  1>
  160.    up        <0, 1,  0>
  161.    right   <4/3, 0,  0>
  162.    look_at   <0, Cht/2, 1.5>
  163. }
  164.  
  165. light_source {<50, 500, -200> color White}
  166.  
  167. background {color Gray50}
  168.  
  169. default {
  170.   finish {
  171.     ambient .3
  172.     diffuse .8
  173.   }
  174. }
  175.  
  176.  
  177.  
  178. //////////////////////
  179. // Demo Objects
  180. //////////////////////
  181.  
  182. #declare Mrad = .3
  183.  
  184. cylinder {
  185.   <-2,0,0>,
  186.   <-2,Cht,0>, Mrad
  187.   texture {NBmarble}
  188. }
  189.  
  190.  
  191.  
  192. cylinder {
  193.   <-1,0,0>,
  194.   <-1,Cht,0>, Mrad
  195.   texture {NBmarble2}
  196. }
  197.  
  198.  
  199.  
  200. cylinder {
  201.   <0,0,0>,
  202.   <0,Cht,0>, Mrad
  203.   texture {NBmarble3}
  204. }
  205.  
  206.  
  207.  
  208. cylinder {
  209.   <1,0,0>,
  210.   <1,Cht,0>, Mrad
  211.   texture {NBmarble4
  212.     rotate y * 90  //default is boring at this point
  213.   }
  214. }
  215.  
  216.  
  217.  
  218. cylinder {
  219.   <2,0,0>,
  220.   <2,Cht,0>, Mrad
  221.   texture {NBmarble5}
  222. }
  223.  
  224.  
  225. // Supplied textures 
  226.  
  227.  
  228. cylinder {
  229.   <-1,0,2>,
  230.   <-1,Cht,3>, Mrad
  231.   texture {Red_Marble}
  232. }
  233.  
  234.  
  235.  
  236. cylinder {
  237.   <0,0,2>,
  238.   <0,Cht,3>, Mrad
  239.   texture {White_Marble}
  240. }
  241.  
  242.  
  243.  
  244. cylinder {
  245.   <1,0,2>,
  246.   <1,Cht,3>, Mrad
  247.   texture {Blood_Marble}
  248. }
  249.  
  250.  
  251.