POV-Ray : Newsgroups : povray.text.scene-files : Another Lightning macro Server Time
5 Jul 2024 09:44:53 EDT (-0400)
  Another Lightning macro (Message 11 to 20 of 21)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>
From: Tom Melly
Subject: Re: Another Lightning macro
Date: 3 May 2001 06:28:17
Message: <3af132c1@news.povray.org>
"Nekar Xenos" <j-p### [at] citywalkcoza> wrote in message
news:3af12624@news.povray.org...
> > Will you post your modified version (the one using your lightning)?
>
> I was going to but I had that stiffy(3.5" disk unable to read stuff)
problem
> again. Can't wait till I get a CDRW so that I can bring files from home...
> I'll try again tomorrow. But I think it would be better if I could
> completely replace you branches with mine. That would be easy if you could
> modify your version to have only straight arms without the 'jaggedness'.
> Could you try that for me. I'm still rather 'new' to coding so it's not
> always that easy for me to decipher what is what.
>
> Thanks
>

Well, removing the jaggedness is easy enough:

#declare xShift = segPosA.x; // + ((rand(myRand)-0.5)*LSpike) + xPlus;
#declare yShift = segPosA.y + 0.5; // (rand(myRand)/5);
#declare zShift = segPosA.z; // + ((rand(myRand)-0.5)*LSpike) + zPlus;

The trouble is that all the forks then just go straight down. Is that what
you meant? (probably not).

The most significant params are LSpread and LSpike in terms of the basic
shape of the bolt.

Try these four settings:

//Make_Bolt(500, 11211, 0.03, 6, 0.3, 0.05, 0.5, 0.2) // normal (whatever
that means)
//Make_Bolt(500, 11211, 0.03, 6, 0.0003, 0.05, 0.5, 0.2)  // small LSpread -
quite 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
and LSpike


Post a reply to this message

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

<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>

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