POV-Ray : Newsgroups : povray.text.scene-files : Another Lightning macro Server Time
5 Jul 2024 10:27:25 EDT (-0400)
  Another Lightning macro (Message 12 to 21 of 21)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Tom Melly
Subject: Re: Another Lightning macro
Date: 3 May 2001 06:30:20
Message: <3af1333c@news.povray.org>
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3af132c1@news.povray.org...

Oh, Outlook....

Make_Bolt(500, 11211, 0.03, 6, 0.3, 0.05, 0.5, 0.2) // normal
Make_Bolt(500, 11211, 0.03, 6, 0.0003, 0.05, 0.5, 0.2)  // small LSpread -
nice
Make_Bolt(500, 11211, 0.03, 6, 0.3, 0.05, 0.5, 0.0002) // small LSpike
Make_Bolt(500, 11211, 0.03, 6, 0.0003, 0.05, 0.5, 0.0002) // small LSpread &
LSpike


Post a reply to this message

From: Chris Huff
Subject: Re: Another Lightning macro
Date: 3 May 2001 06:32:43
Message: <chrishuff-264ADB.05301703052001@news.povray.org>
In article <3af1203a$1@news.povray.org>, "Tom Melly" 
<tom### [at] tomandlucouk> wrote:

> Hmm, well I ran this with mp (obviously), but I can't get the 
> lightening to light up the scene, which would seem to indicate that 
> emitting media doesn't contribute to radiosity. Am I missing 
> something?

Yeah, you are. From the MegaPOV documentation, section 10.2.7, 
"Miscellaneous changes & bug fixes":

"Radiosity estimation can be affected by media. To enable this feature, 
add media on to the radiosity {} block within global_settings {}."

Sorry I wasn't more specific in my previous post...

PS: "lightning", not "lightening". The same error was made in the 
include files...

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Nekar Xenos
Subject: Re: Another Lightning macro
Date: 3 May 2001 07:10:44
Message: <3af13cb4@news.povray.org>
Thanks, I'll see what I can do.

BTW a workaround for the file://problem is to  /* use these */ instead

Nekar


"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3af1333c@news.povray.org...
> "Tom Melly" <tom### [at] tomandlucouk> wrote in message
> news:3af132c1@news.povray.org...
>
> Oh, Outlook....
>
> Make_Bolt(500, 11211, 0.03, 6, 0.3, 0.05, 0.5, 0.2) // normal
> Make_Bolt(500, 11211, 0.03, 6, 0.0003, 0.05, 0.5, 0.2)  // small LSpread -
> nice
> Make_Bolt(500, 11211, 0.03, 6, 0.3, 0.05, 0.5, 0.0002) // small LSpike
> Make_Bolt(500, 11211, 0.03, 6, 0.0003, 0.05, 0.5, 0.0002) // small LSpread
&
> LSpike
>
>
>


Post a reply to this message

From: Tom Melly
Subject: Re: Another Lightning macro
Date: 3 May 2001 07:28:33
Message: <3af140e1$1@news.povray.org>
"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-264ADB.05301703052001@news.povray.org...
> In article <3af1203a$1@news.povray.org>, "Tom Melly"
> <tom### [at] tomandlucouk> wrote:
>
>
> Yeah, you are. From the MegaPOV documentation, section 10.2.7,
> "Miscellaneous changes & bug fixes":
>
> "Radiosity estimation can be affected by media. To enable this feature,
> add media on to the radiosity {} block within global_settings {}."

Aha! Many thanks.

>
> Sorry I wasn't more specific in my previous post...

You are forgiven ;)

> PS: "lightning", not "lightening". The same error was made in the
> include files...

I know, I know.... I've corrected several, but missed more. It's a word that
I habitually mispell. My mind knows how it is spelt, but my fingers
disagree...


Post a reply to this message

From: Nekar Xenos
Subject: Re: Another Lightning macro
Date: 3 May 2001 07:33:09
Message: <3af141f5@news.povray.org>
What I actually meant is it should have straight branches like the tree in
Robert J Becrafts IRTC fortress entry.(posted 2001/04/28 21:56 PM in
p.b.i.).  The number of cylinders in the whole lightning bolt should be the
same as the number of branches(stem included).  So it would look like a
'stick drawing'.
Like this:
                  \
                   /\_
                  /I I I\

Each symbol represents 1 cylinder.

As I have exact control over where to put my lightning bolt I can then just
replace each cylinder with one of my lightning bolts.
I hope this explains it better.

Thanks

Nekar


Post a reply to this message

From: Tom Melly
Subject: Re: Another Lightning macro
Date: 3 May 2001 08:22:18
Message: <3af14d7a$1@news.povray.org>
"Nekar Xenos" <j-p### [at] citywalkcoza> wrote in message
news:3af141f5@news.povray.org...

<snip>

Ah! Now I understand. Hmm, my first thought was that this was impossible
with the way my macro works, but I have a cunning plan....

Get back to you later...


Post a reply to this message

From: Tom Melly
Subject: Re: Another Lightning macro
Date: 3 May 2001 12:19:17
Message: <3af18505$1@news.povray.org>
Hey, it worked! (image in binary.images - no lights, just emitting media)

"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-264ADB.05301703052001@news.povray.org...
>
> Yeah, you are. From the MegaPOV documentation, section 10.2.7,
> "Miscellaneous changes & bug fixes":
>
> "Radiosity estimation can be affected by media. To enable this feature,
> add media on to the radiosity {} block within global_settings {}."


Post a reply to this message

From: Tom Melly
Subject: Re: Another Lightning macro
Date: 3 May 2001 18:24:55
Message: <3af1dab7@news.povray.org>
Tom Melly wrote in message <3af14d7a$1@news.povray.org>...
>
>Get back to you later...
>

Try this - you only get an object stretching between junctions, you can also
use any object as your key shape.


// use any object as your building block (needs to take 2 co-ords)
#macro Cylinder_Object(CStart, CEnd, CWidth)
  cylinder{CStart, CEnd, CWidth}
#end

#macro Box_Object(BCorner1, BCorner2)
  box{BCorner1, BCorner2}
#end

//plane{y, 0 pigment{checker Gray, Green}}
#macro Make_Bolt(LArraySize, LSeed, LWidth, LHeight, LSpread, LBranch,
LCutoff)

  #declare myArray = array[LArraySize]
  #declare checkCount = -1;
  #declare highCount = 0;
  #declare arrayCount = 0;
  #declare myArray[arrayCount] = <0,0,0>;
  #declare myRand = seed(LSeed);

  #declare Lightning_Bolt =
  merge{
    #while (checkCount < highCount)
      #declare checkCount = checkCount + 1;
      #declare segPosA = myArray[arrayCount];
      #declare segPosB = segPosA;
      #declare arrayCount = arrayCount + 1;
      #declare xPlus = (rand(myRand)-0.5)*LSpread;
      #declare zPlus = (rand(myRand)-0.5)*LSpread;
      #declare no_base = true;
      #while(segPosB.y < LHeight)
        #declare xShift = segPosB.x + xPlus;
        #declare yShift = segPosB.y + (rand(myRand)/5);
        #declare zShift = segPosB.z + zPlus;
        #if (yShift > LHeight)
          #declare yShift = LHeight;
        #end
        #declare segPosB = <xShift, yShift, zShift>;
        #declare randNum = rand(myRand);
        #if (randNum < LBranch & segPosB.y > LCutoff) // we only need a new
cylinder here
          Cylinder_Object(segPosA, segPosB, LWidth)
//          Box_Object(segPosA, segPosB)
          #declare no_base = false;
          #declare segPosA = segPosB;
          #declare highCount = highCount + 1;
          #declare myArray[highCount] = segPosA;
        #end
      #end
      #if(no_base & segPosB.y < LHeight)
        Cylinder_Object(segPosA, segPosB, LWidth)
//        Box_Object(segPosA, segPosB)
      #end
      #declare LWidth = (LWidth*0.9);
    #end
  }
#end

//#macro Make_Bolt(LArraySize, LSeed, LWidth, LHeight, LSpread, LBranch,
LCutoff)
Make_Bolt(500, 11211, 0.03, 6, 0.5, 0.05, 0.5)

object{
  Lightning_Bolt
  pigment{rgbt 1}
  interior{media{emission<3,3,5>*5}}
  hollow
  rotate x*180
  no_shadow
  translate y*5
}


Post a reply to this message

From: Nekar Xenos
Subject: Re: Another Lightning macro
Date: 4 May 2001 02:05:15
Message: <3af2469b@news.povray.org>
Thanks.

I probably won't be here again before Monday. I'll post the result then.

Nekar
--
#version unofficial MegaPov 0.7;#local Q=seed(7);#local S=<-2,2,5>;#local
E=<2
,-2,5>;#local B=S;#while(vlength(B-E)>.1)#local
B=(B+(<rand(Q),rand(Q),rand(Q)
>/20));#local B=B-(2*(B-S))*((vlength(B-E)>vlength(S-E)));#local
S=B;glow{//NX
location S size.1 radius.07}glow{location S size.1 radius.07 rotate
z*90}#end


Post a reply to this message

From: Nekar Xenos
Subject: Re: Another Lightning macro
Date: 6 May 2001 06:03:20
Message: <3af52168@news.povray.org>
I've added my lightning in but there are empty spaces between the branches.
I'm not quite sure why.

Nekar

#version unofficial MegaPov 0.6;
camera{location  <0.0, 0.5, -10.0> look_at   <2, 1,  0.0>}
// use any object as your building block (needs to take 2 co-ords)
#macro Cylinder_Object(CStart, CEnd, CWidth)
  cylinder{CStart, CEnd, CWidth}
#end

#macro Box_Object(BCorner1, BCorner2)
  box{BCorner1, BCorner2}
#end

// plane{y, 0 pigment{checker Gray, Green}}

#macro Bolt (LightnStart, LightnEnd, Scale,Seed)
#ifndef (Seed)
  #local Seed=seed(0)                     ;
 #end
#ifndef (LightnStart)
  #local LightnStart=<0,0,0>         ;
 #end
#ifndef (LightnEnd)
  #local LightnEnd=<0,0,0>      ;
 #end
#ifndef (Scale)
  #local Scale=0.05        ;
 #end
// #ifndef (Color)
//  #local Color=<1,1,1>        ;
// #end

#local Seed = seed(Seed);

#local BlobPosition =  LightnStart   ;

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

     #while (vlength(BlobPosition - LightnEnd) > 0.1)
     #local Rx=rand(Seed);  #local Ry=rand(Seed); #local Rz=rand(Seed);
             #local BlobPosition = ( BlobPosition + (<0.5-Rx, 0.5-Ry,
0.5-Rz> * 0.04 ) )   ;

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

         #local LightnStart = BlobPosition ;


   sphere { <0,0,0>, 1, 1
      scale Scale
      translate LightnStart
   }

   #end

      sphere { <0,0,0>, 1, 1
      scale Scale
      translate LightnEnd }

 //  pigment{rgbt 1}interior{media{emission Color }}hollow
}

#end


#macro Make_Bolt(LArraySize, LSeed, LWidth, LHeight, LSpread, LBranch,
LCutoff)

  #declare myArray = array[LArraySize]
  #declare checkCount = -1;
  #declare highCount = 0;
  #declare arrayCount = 0;
  #declare myArray[arrayCount] = <0,0,0>;
  #declare myRand = seed(LSeed);

  #declare Lightning_Bolt =
  merge{
    #while (checkCount < highCount)
      #declare checkCount = checkCount + 1;
      #declare segPosA = myArray[arrayCount];
      #declare segPosB = segPosA;
      #declare arrayCount = arrayCount + 1;
      #declare xPlus = (rand(myRand)-0.5)*LSpread;
      #declare zPlus = (rand(myRand)-0.5)*LSpread;
      #declare no_base = true;
      #while(segPosB.y < LHeight)
        #declare xShift = segPosB.x + xPlus;
        #declare yShift = segPosB.y + (rand(myRand)/5);
        #declare zShift = segPosB.z + zPlus;
        #if (yShift > LHeight)
          #declare yShift = LHeight;
        #end
        #declare segPosB = <xShift, yShift, zShift>;
        #declare randNum = rand(myRand);
        #if (randNum < LBranch & segPosB.y > LCutoff) // we only need a new
cylinder here
        // Bolt (LightnStart, LightnEnd, Scale, Seed)
        Bolt (segPosA, segPosB,LWidth,myRand)

        //  Cylinder_Object(segPosA, segPosB, LWidth*2)
        //  Box_Object(segPosA, segPosB)
          #declare no_base = false;
          #declare segPosA = segPosB;
          #declare highCount = highCount + 1;
          #declare myArray[highCount] = segPosA;
        #end
      #end
      #if(no_base & segPosB.y < LHeight)
      Bolt (segPosA, segPosB,LWidth,myRand)

     //   Cylinder_Object(segPosA, segPosB, LWidth*2)
//        Box_Object(segPosA, segPosB)
      #end
      #declare LWidth = (LWidth*0.95);
    #end
  }
#end

// #macro Make_Bolt(LArraySize, LSeed, LWidth, LHeight, LSpread, LBranch,
LCutoff)
Make_Bolt(500, 11, 0.05, 6, 0.1, 0.06, 0.5)

object{
  Lightning_Bolt
  pigment{rgbt 1}
  interior{media{emission<3,4,5>}}
  hollow
  rotate x*180
  no_shadow
  translate y*5
}


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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