home *** CD-ROM | disk | FTP | other *** search
/ Ray Tracing Box / RAY_CD.mdf / raytrace / _pov_dat / plasgl / plasglo.pov < prev   
Text File  |  1994-03-01  |  6KB  |  223 lines

  1. //---------------------
  2. // plasglo.pov
  3. // Plasma globe object for Truman Brown's POV-Ray room project
  4. // By Dan Farmer CIS 70703,1632
  5. // All rights released to the public domain.
  6. //---------------------
  7.  
  8. #include "colors.inc"
  9. #include "textures.inc"
  10. #include "coil.inc"         // Tru: optional.  Don't use if too slow.
  11.  
  12. #declare MainCam = camera {
  13.    location  <5, 12.5, -22>
  14.    direction <0, 0,  1>
  15.    up        <0, 1,  0>
  16.    sky y*1
  17.    right     <4/3, 0,  0>
  18.    look_at   <0, 5, 0>
  19. }
  20.  
  21. // Flat view, use with white background for best view
  22. #declare TestCam = camera {
  23.    location  <0.0, 0.1, -10>
  24.    direction <0, 0,  1>
  25.    up        <0, 1,  0>
  26.    right     <4/3, 0,  0>
  27.    look_at   <0, 0.0, 0>
  28. }
  29.  
  30. //camera { TestCam }
  31. //background { color White }
  32.  
  33. camera { MainCam }
  34. background { color Gray20 }
  35.  
  36. // These are all independant of the actual object.  
  37. // (ie: needed for preview only)
  38. light_source {<10, 20, -10> color White }
  39. light_source {<3, 10, -4> color White }
  40. light_source {<-30, 10, 4> color White }
  41.  
  42. // Environment (for preview only)
  43. //--------------------------------
  44. #declare Environment = union {
  45.  
  46.     // Left wall
  47.     plane { x, -8
  48.         texture { pigment {color Gray10} finish { reflection 0.35 }}
  49.         rotate y*45
  50.     }
  51.  
  52.     // Right wall
  53.     plane { x, 6
  54.         texture { pigment { color Gray10} finish { reflection 0.35 }}
  55.         rotate -y*45
  56.     }
  57.  
  58.     // Floor
  59.     plane { y, 0
  60.         texture { 
  61.             pigment { color Gray15 } 
  62.             finish { reflection 0.5 }
  63.         }
  64.     }
  65. }
  66.  
  67.  
  68. // Place the mirrored walls for preview
  69. object { Environment }
  70.  
  71. //============================================================================
  72. // Plasma Globe by Dan Farmer
  73. // Dimensions:
  74. // width / depth : -5 to 5
  75. // height: 0 to 12.5 
  76.  
  77. //---------- plasma globe color/texture declarations 
  78. //
  79. // Also requires from textures.inc:
  80. //   Shiny
  81. //   Polished_Brass
  82. //   Glass3
  83.  
  84. #declare DMF_Med_Purple =  colour red 0.73 green 0.16 blue 0.96 filter 0.95
  85. #declare DMF_Light_Purple = colour red 0.87 green 0.58 blue 0.98 filter 0.85
  86. #declare DMF_Very_DMF_Light_Purple = colour red 0.94 green 0.81 blue 0.99 filter 0.65
  87.  
  88. #declare DMF_Lightening_CMap1 =  color_map {
  89.     [0.00 0.15 color White color DMF_Very_DMF_Light_Purple]
  90.     [0.15 0.25 color DMF_Very_DMF_Light_Purple color DMF_Very_DMF_Light_Purple  ]
  91.     [0.25 0.30 color DMF_Very_DMF_Light_Purple  color DMF_Light_Purple ]
  92.     [0.30 0.40 color DMF_Light_Purple  color DMF_Light_Purple ]
  93.     [0.40 0.45 color DMF_Light_Purple  color DMF_Med_Purple ]
  94.     [0.50 1.00 color DMF_Med_Purple  color DMF_Med_Purple ]
  95. }
  96.  
  97. #declare DMF_Lightening1 = texture {
  98.     pigment {
  99.         marble
  100.         color_map { DMF_Lightening_CMap1 }
  101.         turbulence <0.5, 0.5, 0.5>
  102.     }
  103.     finish { ambient 1 }
  104. }
  105. #declare DMF_Lightening_CMap2 =  color_map {
  106.     [0.00 0.10 color White color DMF_Very_DMF_Light_Purple]
  107.     [0.10 0.20 color DMF_Very_DMF_Light_Purple color DMF_Very_DMF_Light_Purple  ]
  108.     [0.20 0.30 color DMF_Very_DMF_Light_Purple  color DMF_Light_Purple ]
  109.     [0.30 0.45 color DMF_Light_Purple  color DMF_Light_Purple ]
  110.     [0.45 0.65 color DMF_Light_Purple  color DMF_Med_Purple ]
  111.     [0.65 1.00 color DMF_Med_Purple  color DMF_Med_Purple ]
  112. }
  113.  
  114. #declare DMF_Lightening2 = texture {
  115.     pigment {
  116.         granite
  117.         color_map { DMF_Lightening_CMap2 }
  118.         turbulence <0.5, 0.5, 0.5>
  119.     }
  120.     finish { ambient 1 }
  121. }
  122.  
  123. #declare DMF_Brushed_Aluminum = texture {
  124.     Chrome_Metal
  125.     normal {
  126.         bumps -0.5
  127.         scale <1, 0.001, 0.001>
  128.     }
  129. }
  130.  
  131. // Begin plasma globe object
  132. //---------------------------
  133.  
  134. // Quick substitute for the somewhat slowish plasma texture
  135. #declare QTest = texture { pigment { Red } finish { Shiny } }
  136.  
  137. // Outer globe, influences inner colors.  No IOR required
  138. #declare DMF_Globe =
  139.     sphere { <0,0,0>, 1.2 
  140.     texture { Glass3 pigment { DMF_Light_Purple filter 0.975 } finish { ior 1 }}
  141. //    texture { QTest } 
  142. }
  143.  
  144.  
  145. // Two concentric inner globes textured with the lightening storm texture
  146. #declare DMF_Plasma = 
  147.     union {
  148.     sphere { <0,0,0>, 1.15 
  149.         texture { DMF_Lightening2 scale 1.5 } 
  150. //        texture { QTest } 
  151.     }
  152.     sphere { <0,0,0>, 0.75 
  153.         texture { DMF_Lightening1 rotate <45, 90, 30> } 
  154. //        texture { QTest } 
  155.     }
  156. }
  157.  
  158. // A shiny sphere, concentric to the globes
  159. #declare DMF_Electrode = 
  160.     sphere { <0,0,0>, 0.35
  161.     texture { Polished_Brass }
  162. }
  163.  
  164. #declare DMF_Globe_Asm = union {
  165.     object { DMF_Globe }
  166.     object { DMF_Plasma }
  167.     object { DMF_Electrode }
  168.     bounded_by { sphere { <0,0,0>, 1.2 } }
  169. }
  170.  
  171. // Tube connecting globe/electrode to base
  172. #declare DMF_Tower = union {
  173.     cylinder { <0, -3, 0> <0, 0, 0>, 0.2 texture { DMF_Brushed_Aluminum } }
  174.     object { DMF_Coil texture { Polished_Brass } rotate z*180 }
  175. }
  176.  
  177.  
  178. // Bumpy gray plastic base
  179. #declare DMF_Base = 
  180.     cylinder { -y*2.5, -y*2, 1.55
  181.     pigment { Gray15 }
  182.     finish { reflection 0.5 }
  183.     normal { bumps 0.5 scale 0.005 }
  184. }
  185.  
  186. // Control knob, gray with aluminum cap
  187. #declare DMF_Knob = 
  188.     union {
  189.     disc { -y*1.8999, -y, 0.075 
  190.         texture { DMF_Brushed_Aluminum }
  191.     }
  192.     cone { -y*2, 0.1, -y*1.9, 0.075
  193.         texture { pigment { Gray15 } finish { Shiny }}
  194.     }
  195. }
  196.  
  197. // The final object
  198. #declare DMF_LighteningGlobe = 
  199. union { 
  200.     object { DMF_Globe_Asm }
  201.     object { DMF_Tower }
  202.     union {  
  203.         object { DMF_Knob translate <0.8, 0.75, -0.8> }
  204.         object { DMF_Base translate y*0.300  scale 0.80  }
  205.         object { DMF_Base translate y*0.285  scale 0.95 }
  206.         object { DMF_Base translate y*0.275 }
  207.         translate -y*1
  208.     }
  209.     bounded_by { box { <-2.25, -3, -2.25> <2.25, 1.25, 2.25> } }
  210.     translate y * 3     // Place base at y=0
  211.     scale 3             // It's too small.  Let's cheat.
  212. }
  213.  
  214. // Test for outer bounding box
  215. //box { <-2.25, -3, -2.25> <2.25, 1.25, 2.25> 
  216. //    pigment { White filter 0.85 }
  217. //    translate y * 3     // Place base at y=0
  218. //} 
  219.  
  220. // Place the object
  221. object { DMF_LighteningGlobe }
  222.  
  223.