POV-Ray : Newsgroups : povray.binaries.images : Sparky (for Dave VanHorn) : Sparky (for Dave VanHorn) Server Time
13 Nov 2024 17:48:06 EST (-0500)
  Sparky (for Dave VanHorn)  
From: Ger
Date: 20 May 2004 07:35:13
Message: <40ac97e9@news.povray.org>
A quick and dirty try to get the spark to emit light.

I tightened the spark and added a bunch of lights to it.
The cylinders in the background are just to give an idea about the shadowing
on the back wall.

You may have to play with the "Spark_Light" settings to get the effects you
want.

#declare Discharge_Spark = 
object{
  cylinder { <-1,0,-10>, <1,0,10>, 4}
    hollow pigment { Clear }
    interior {media{method 3    // 3
    aa_level 4                  // 4
    aa_threshold 0.1            // 0.1
    samples 16, 100             // Min 1, Max 1
    intervals 1                 // 10
    ratio 0.9                   // 0.9
    confidence 0.9              // 0.9
    variance 1/128              // 1/128
    jitter 0
    emission <10,10,12>         //High values obscure the core
    density {cylindrical
       rotate x*90
       color_map { [ 0.00 Black ]
                   [ 0.60 rgb <0.15, 0.4,1.0>*0.02]
                   [ 0.94 rgb <0.15, 0.4,1.0>*0.1]
                   [ 0.97 rgb <0.05, 1.0,0.05>*5] //Accent
                   [ 0.98 rgb <0.15, 0.4,1.0>*0.2]
                   [ 0.99 rgb <0.15, 0.4,1.0>*60]
                  }
     warp{turbulence<0.1,1,0.1>         // amount of turbulence
          octaves 8                                              // 10- too much 
       // optional turbulence modifiers
          lambda 5 // 10 is "grainy"
          omega 0.2 //0.1 sinuous 0.9 chaotic
         }
         }
        }
      scale<2,2,1>
      }
                
#macro Spark_Light(Start,End,NumOfLights,TotalBrightness,FP,FD) 
#local Distance = (End - Start) / NumOfLights+1;
#local Brightness = TotalBrightness / NumOfLights;
union {
        #local Count = Start+Distance;
        #while (Count <= End-Distance)
                light_source { 0 color rgb<0.15, 0.4, 1.0> * Brightness translate
<0,0,Count> fade_power FP fade_distance FD }
                #local Count = Count + Distance;
        #end
        }
#end

// Overhead lights
light_source { 0 color rgb 0.75 translate < -30 , 100 , 0 > }
light_source { 0 color rgb 0.75 translate < 30 , 150 , 0 > }

        
#declare Spark_Terminal =
union {
        sphere {<0,0,-20>,4}
        sphere {<0,0, 20>,4}
        cylinder {<0,0,-20>,<0,-40,-20>,1}
        cylinder {<0,0, 20>,<0,-40, 20>,1}
        cylinder {<0,0,-16>,<0,0,-12>,1}
        cylinder {<0,0, 16>,<0,0, 12>,1}
        difference {
                        sphere {<0,0,-14>,4}
                        cylinder {<0,0,-20>,<0,0,20>,2 inverse}
                        plane { z , 0 translate <0,0,-12> }
                        }
        difference {
                        sphere {<0,0, 14>,4}
                        cylinder {<0,0,-20>,<0,0,20>,2 inverse}
                        plane {-z , 0 translate <0,0, 12> }
                        }
//      cone {<0,0,-12>,2,<0,0,-10>,-0}
//      cone {<0,0, 12>,2,<0,0, 10>, 0}
        texture { T_Gold_3A }
        }
        
#declare Kaboom =
union {
        object { Spark_Terminal }
        object { Discharge_Spark }
        Spark_Light(-10, 10, 150, 500, 1.25, 2)
        translate < 0 , 10 , 0 >
        }
        
camera {
        location <40 , 14 , 20 >
        look_at < 0 , 8 , 0 >
        }


plane { x , -40 pigment { Gray70 } finish { Shiny}}
plane { y , 0 pigment { Gray50 } finish { Shiny }}
cylinder {<-25,0,5>,<-25,12,5>,5 texture { Polished_Chrome }}
cylinder {<-25,0,-15>,<-25,18,-15>,10 texture { Polished_Chrome }}

object { Kaboom }


-- 
Ger


Post a reply to this message


Attachments:
Download 'sparky.jpg' (37 KB)

Preview of image 'sparky.jpg'
sparky.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.