POV-Ray : Newsgroups : povray.binaries.scene-files : Lightning code Server Time
2 Sep 2024 16:18:07 EDT (-0400)
  Lightning code (Message 1 to 6 of 6)  
From: Nekar Xenos
Subject: Lightning code
Date: 2 May 2001 03:57:59
Message: <3aefbe07@news.povray.org>
Here's my lightning code.

Feel free to improve it....

Nekar


Post a reply to this message


Attachments:
Download 'LightnBr.pov.txt' (10 KB)

From: Ben Birdsey
Subject: Re: Lightning code
Date: 9 May 2001 22:08:24
Message: <3AF9F97E.3DC141B0@mail.com>
Here's a new "quick and dirty lightning".  The code works, but the
textures are not as advanced as this original, but I'll let someone else
worry about that.

	It works by recursively generating a "fractal" path using midpoint
replacement.  I think it looks good, but let's see what the community
thinks.

	Gentlemen (and women), start your renderers!

-Ben
 <><


Post a reply to this message


Attachments:
Download 'lightning2.pov.txt' (9 KB)

From: Nekar Xenos
Subject: Re: Lightning code
Date: 10 May 2001 02:16:45
Message: <3afa324d@news.povray.org>
Thanks!

Nekar Xenos


--
#local N=<-4,8,20>;#local K=<4,-8,20>;#local R=seed(0);union{#while((K-N).x>0)
#local X=N;#local N=N+<rand(R),rand(R),1>/30;#local N=(vlength(N-K)<vlength(X-K
)?N:2*X-N);sphere{<N.y,-N.x,N.z>,.2}sphere{N,.2}sphere{<-N.x-8,N.y,N.z>,.1//-NX
pigment{rgb N}}sphere{<N.x+8,-N.y,N.z>,.1 pigment{rgb N}}#end pigment{rgb 9}}


Post a reply to this message

From: Nekar Xenos
Subject: Re: Lightning code
Date: 10 May 2001 03:32:58
Message: <3afa442a@news.povray.org>
It won't work on my machine. I'm running PovWin 3.1g on Windows NT4.

It first gave me an error


    #macro push(s <----ERROR
    lightning2: error: identifier or expression, expected but s found instead.

so I replaced al the 's's with 'S's.

then I got the message that you can't use a negative fractional power in pow()
so I added an abs.

After quite a bit of parsing and ':' after #declares errors on line74 I got

    #declare S[sp][2] = col;
     #render.....
    #else

    #error concat("Stack pointer :",str(sp,5,0),"
maxstack:",str(maxstack,5,0),"/n") <----ERROR

    memory macro:68: error: user error directive hit.

And I don't have a clue what this is. How come it works on your machine and not
mine?

"Ben Birdsey" <cla### [at] mailcom> wrote in message
news:3AF9F97E.3DC141B0@mail.com...
>
> Here's a new "quick and dirty lightning".  The code works, but the
> textures are not as advanced as this original, but I'll let someone else
> worry about that.
>
> It works by recursively generating a "fractal" path using midpoint
> replacement.  I think it looks good, but let's see what the community
> thinks.
>
> Gentlemen (and women), start your renderers!
>
> -Ben
>  <><


Post a reply to this message

From: Gail Shaw
Subject: Re: Lightning code
Date: 10 May 2001 04:53:15
Message: <3afa56fb@news.povray.org>
Nekar Xenos <j-p### [at] citywalkcoza> wrote in message
news:3afa442a@news.povray.org...
> It won't work on my machine. I'm running PovWin 3.1g on Windows NT4.

Sure you're not using Megapov?

> It first gave me an error
>
>
>     #macro push(s <----ERROR
>     lightning2: error: identifier or expression, expected but s found
instead.
>
> so I replaced al the 's's with 'S's.

s is a legal variable name in official pov, but not in mega

I just tried it in megapov 0.6  and official 3.1g. works in official, not in
mega

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 code
Date: 10 May 2001 05:18:19
Message: <3afa5cdb@news.povray.org>
You're right. Sorry about that.

Thanks

Nekar


--
#local N=<-4,8,20>;#local K=<4,-8,20>;#local R=seed(0);union{#while((K-N).x>0)
#local X=N;#local N=N+<rand(R),rand(R),1>/30;#local N=(vlength(N-K)<vlength(X-K
)?N:2*X-N);sphere{<N.y,-N.x,N.z>,.2}sphere{N,.2}sphere{<-N.x-8,N.y,N.z>,.1//-NX
pigment{rgb N}}sphere{<N.x+8,-N.y,N.z>,.1 pigment{rgb N}}#end pigment{rgb 9}}


Post a reply to this message

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