POV-Ray : Newsgroups : povray.text.scene-files : Lightning Server Time
3 Jul 2024 02:10:06 EDT (-0400)
  Lightning (Message 1 to 1 of 1)  
From: Nekar Xenos
Subject: Lightning
Date: 28 Apr 2001 05:14:34
Message: <3aea89fa@news.povray.org>
/// Here's my try at lightning.  - Nekar Xenos ////

global_settings
{
  assumed_gamma 1.0
}

// ----------------------------------------
camera
{
  location  <0.0, 0.5, -5.0>
  look_at   <0.0, 0.0,  0.0>
}
#declare R1 = seed(2531);

#declare StrengthVal = 1.0 ;
#declare RadiusVal   = 1 ;
#declare Scale = 0.1  ;

#declare LightnStartX = -1    ;
#declare LightnStartY = 3    ;
#declare LightnStartZ = 5    ;
#declare LightnStart = < LightnStartX, LightnStartY, LightnStartZ >
;

#declare LightnEndX = 0  ;
#declare LightnEndY = -4  ;
#declare LightnEndZ = 6  ;
#declare LightnEnd = < LightnEndX, LightnEndY, LightnEndZ >     ;

#declare BlobPosition = LightnStart    ;

#declare Amp = 0.04   ; // Amplitude of 'waves'

blob
{
  threshold 0.6
  sphere { <0,0,0>, StrengthVal, RadiusVal
  scale Scale
   translate LightnStart
   }
   /////     Add random blob closer to lightnEnd

     #while (vlength(BlobPosition - LightnEnd) > 0.1)
     #declare Rx=rand(R1);  #declare Ry=rand(R1); #declare Rz=rand(R1);
             #declare BlobPosition = ( BlobPosition + (<0.5-Rx, 0.5-Ry,
0.5-Rz> * < Amp, Amp, Amp > ) )   ;

         #if ( ( vlength(BlobPosition - LightnEnd) >  vlength (LightnStart -
LightnEnd) ))
                #declare BlobPosition =  (BlobPosition -
 ( 2*(BlobPosition - LightnStart) )) ;
                #end

         #declare LightnStart = BlobPosition ;

 /////

   sphere { <0,0,0>, StrengthVal, RadiusVal
      scale Scale
      translate LightnStart
   }

   #end

      sphere { <0,0,0>, StrengthVal, RadiusVal
      scale Scale
      translate LightnEnd }

   pigment{rgbt 1}interior{media{emission<1,5,5>*1  }}hollow
}


Post a reply to this message

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