POV-Ray : Newsgroups : povray.binaries.images : Lightning WIP Server Time
18 Aug 2024 14:16:36 EDT (-0400)
  Lightning WIP (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Nekar Xenos
Subject: Lightning WIP
Date: 28 Apr 2001 05:24:10
Message: <3aea8c3a@news.povray.org>
My first try at lightning.
I can't seem to get it to show on any other background though. I also still
need to figure out how to do the branches.

The code is posted to p.t.s

Comments and help welcome.

Nekar


Post a reply to this message


Attachments:
Download 'Lightning.jpg' (6 KB)

Preview of image 'Lightning.jpg'
Lightning.jpg


 

From: ingo
Subject: Re: Lightning WIP
Date: 28 Apr 2001 06:06:11
Message: <Xns90917B7B789B3seed7@povray.org>
in <3aea8c3a@news.povray.org> Nekar Xenos wrote:

> I can't seem to get it to show on any other background though.

Add absorbing media, with complement colour to the emitting media.

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Nekar Xenos
Subject: Re: Lightning WIP
Date: 28 Apr 2001 06:09:14
Message: <3aea96ca@news.povray.org>
I've got it working now.

Thanks

Nekar


Post a reply to this message

From: Gail Shaw
Subject: Re: Lightning WIP
Date: 28 Apr 2001 07:11:47
Message: <3aeaa573@news.povray.org>
Nekar Xenos <j-p### [at] citywalkcoza> wrote in message
news:3aea8c3a@news.povray.org...
> My first try at lightning.
> I can't seem to get it to show on any other background though. I also
still
> need to figure out how to do the branches.
>

Make it recursive.

#macro lightning(......)
 ................
 #if (ChanceToBranch < rand(rnd))
    lightning(.......)
 #end
#end

ChanceToBranch should decrease each time
it recurses so that the macro will finish at some time.

I've got some lightning code that I never finished. If you like
I'll post it.

Gail
*************************************************************************
* gsh### [at] monotixcoza                *   Step into the abyss,           *
* http://www.rucus.ru.ac.za/~gail/   *   and let go.        Babylon 5   *
*************************************************************************
* The difficult we do immediately, the impossible takes a little longer *
*************************************************************************


Post a reply to this message

From: Mr  Art
Subject: Re: Lightning WIP
Date: 28 Apr 2001 07:40:02
Message: <3AEAE47B.299125A2@chesapeake.net>
I don't know about the rest, but I would like to see the code.

Gail Shaw wrote:

> 
> I've got some lightning code that I never finished. If you like
> I'll post it.
> 
> Gail
> *************************************************************************
> * gsh### [at] monotixcoza                *   Step into the abyss,           *
> * http://www.rucus.ru.ac.za/~gail/   *   and let go.        Babylon 5   *
> *************************************************************************
> * The difficult we do immediately, the impossible takes a little longer *
> *************************************************************************


Post a reply to this message

From: Jan Walzer
Subject: Re: Lightning WIP
Date: 28 Apr 2001 17:02:04
Message: <3aeb2fcc@news.povray.org>
I while ago I wrote a macro for lightnings .. I'll see, if I can find it again ...

here is a pic I did with it ...

--
background{rgb 1}camera{location<1,5,-2>look_at 0}#macro m(a,b,i)#local d=(b-a)
/8;#local e=vcross(d,y);#if(i)m(a-e,a+e+2*d,i-1)m(a+e,a+2*d-e,i-1)m(a+3*d-e,a+e
+3*d,i-1)m(a+3*d-e,a+5*d-e,i-1)m(a+6*d-e,a+e+6*d,i-1)m(a+8*d-e,a+e+8*d,i-1)#else
cylinder{a,b,vlength(d)/3 pigment{rgb 0}}#end#end m(-4*x,2*x,4) // Jan Walzer


Post a reply to this message


Attachments:
Download 'img1.png' (65 KB)

Preview of image 'img1.png'
img1.png


 

From: Nekar Xenos
Subject: Re: Lightning WIP
Date: 30 Apr 2001 06:02:42
Message: <3aed3842@news.povray.org>
We're off today at work but I came in just to upload my modifications and
now it seems the stiffy I put it on is messed up. Will bring it in tomorrow.
I first tried making branches at random intervals, but I couldn't get it to
be infrequently enough. I've just thought of something - maybe if I tried
#declare ChanceToBranch = 0.01
#if  (ChanceToBranch > rand(md))
       lighningbranch...
I think this is basically the same as your example below except I haven't
tried a macro yet.

At the moment I've got it to make three branches but I'd like to be able to
specify x amount of branches and y amount of sub-branches for instance.
Something like a modified tree macro.I first tried making branches at random
intervals, but I couldn't get it to be infrequently enough. I've just
thought of something - maybe if I tried
#declare ChanceToBranch = 0.01
#if  (ChanceToBranch > rand(md))
       lighningbranch...


> Make it recursive.
>
> #macro lightning(......)
>  ................
>  #if (ChanceToBranch < rand(rnd))
>     lightning(.......)
>  #end
> #end
>
> ChanceToBranch should decrease each time
> it recurses so that the macro will finish at some time.
>

Thanks. I'm not sure what that 'md' is you've got in the rand statement, can
you explain a little more - unless md is the seed of course.


> I've got some lightning code that I never finished. If you like
> I'll post it.

That would be wonderfull - thank you.

Nekar


Post a reply to this message

From: Nekar Xenos
Subject: Re: Lightning WIP
Date: 30 Apr 2001 06:22:40
Message: <3aed3cf0@news.povray.org>
Not exactly what I was looking for, but can you remember how you did the
branching? (This is more like sparks than lightning)

Nekar

"Jan Walzer" <jan### [at] lzernet> wrote in message
news:3aeb2fcc@news.povray.org...
> I while ago I wrote a macro for lightnings .. I'll see, if I can find it
again ...
>
> here is a pic I did with it ...
>
> --
> background{rgb 1}camera{location<1,5,-2>look_at 0}#macro m(a,b,i)#local
d=(b-a)
> /8;#local
e=vcross(d,y);#if(i)m(a-e,a+e+2*d,i-1)m(a+e,a+2*d-e,i-1)m(a+3*d-e,a+e
>
+3*d,i-1)m(a+3*d-e,a+5*d-e,i-1)m(a+6*d-e,a+e+6*d,i-1)m(a+8*d-e,a+e+8*d,i-1)#
else
> cylinder{a,b,vlength(d)/3 pigment{rgb 0}}#end#end m(-4*x,2*x,4) // Jan
Walzer
>
>
>
>


Post a reply to this message

From: Gail Shaw
Subject: Re: Lightning WIP
Date: 30 Apr 2001 07:25:56
Message: <3aed4bc4@news.povray.org>
Nekar Xenos <j-p### [at] citywalkcoza> wrote in message
news:3aed3842@news.povray.org...
>
> Thanks. I'm not sure what that 'md' is you've got in the rand statement,
can
> you explain a little more - unless md is the seed of course.

Sorry, I always have a random stream called rnd, makes it easier
to remember variable names.

so

#declare rnd=seed(8393);

>
> > I've got some lightning code that I never finished. If you like
> > I'll post it.
>
> That would be wonderfull - thank you.

If I've got a copy with me I'll post it, otherwise on
wednesday. Look in p.t.s-f

Gail
*************************************************************************
* gsh### [at] monotixcoza                *   Step into the abyss,           *
* http://www.rucus.ru.ac.za/~gail/   *   and let go.        Babylon 5   *
*************************************************************************
* The difficult we do immediately, the impossible takes a little longer *
*************************************************************************


Post a reply to this message

From: Nekar Xenos
Subject: Re: Lightning WIP
Date: 2 May 2001 02:01:20
Message: <3aefa2b0@news.povray.org>
"Gail Shaw" <gsh### [at] monotixcoza> wrote in message
news:3aed4bc4@news.povray.org...
>
> Nekar Xenos <j-p### [at] citywalkcoza> wrote in message
> news:3aed3842@news.povray.org...
> >
> > Thanks. I'm not sure what that 'md' is you've got in the rand statement,
> can
> > you explain a little more - unless md is the seed of course.
>
> Sorry, I always have a random stream called rnd, makes it easier
> to remember variable names.
>
> so
>
> #declare rnd=seed(8393);

Oops! When I looked at the post at home I saw it's rnd. Here at work it
looks like md...   ;o)

I'm still trying to figure out you're code... but I'm new to macros, so it
will probably take a while...

Nekar


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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