POV-Ray : Newsgroups : povray.general : Visible Light Rays Server Time
19 Nov 2024 01:50:18 EST (-0500)
  Visible Light Rays (Message 1 to 9 of 9)  
From: Chris Friedl
Subject: Visible Light Rays
Date: 18 Jun 2002 01:22:02
Message: <3d0ec37a@news.povray.org>
Just getting into POV now. I wanted to create "visible" light rays streaming
from an object (do you ever actually see light itself?). You know, like when
the sun shines through a gap in the clouds. POV 3.5 beta6 shows an image of
light through a window in the Insert>Special Effects>Atmospheric Media
mouseover. I also want to animate to have an effect where the light stream
intensity seems to increase and decrease. Sort of like a pulsating, brightly
glowing object sitting in space.

Can anyone give me some clues on how to go about this?

Be Well and Happy Always

Chris


Post a reply to this message

From: bob h
Subject: Re: Visible Light Rays
Date: 18 Jun 2002 02:59:46
Message: <3d0eda62$1@news.povray.org>
"Chris Friedl" <cfr### [at] bigpondnetau> wrote in message
news:3d0ec37a@news.povray.org...
> Just getting into POV now. I wanted to create "visible" light rays
streaming
> from an object

Welcome aboard, Chris.

Yep, just by coincidence and chance I made that scene for the Insert Menu.
The real difficulty in such a thing as media scattering is getting a good
brightness of the light beams while also not darkening everything else out.
Using media within a certain constrained volume is often best for what you
want to do, using a fading light source too, that way the only affected area
is nearby and easier to adjust.

Okay, about the pulsating light. If you want the entire ray beaming object
to pulse that's simply a case of changing the lights color from a small
value to large value and back again. If you'd like the individual rays to
change the thing to do is manipulate the objects texture via filter or
transmit in a pigment pattern. Both would use the 'clock' keyword
multiplied, or whatever, with the float values used in those. Chris Colefax
has a Clock Modifier macro (or the include) which is perfect for this
because it has various ways of increasing and decreasing values over time.
If you're not too adept or quick at learning that, you can just try
something like following for a pulsing light color:

sin(clock*pi)*TheFloatOrVector // use your own color float or vector

Same could be put in as the transparency value instead, for the color map
for example. You need to multiply the clock in that sin() by double number
of times you want it to pulsate. So 8*clock equals 4 pulses.

I have an example made up if you'd like it. Thought I'd ask first if you
might want to try something yourself instead. In the meantime you can always
check out the demo scenes (Scenes\Interior\Media) and that part I did with
the windowed room which is in the Insert Menu folder (CSG_material.pov, last
part).

bob h


Post a reply to this message

From: bob h
Subject: Re: Visible Light Rays
Date: 18 Jun 2002 05:24:57
Message: <3d0efc69@news.povray.org>
"bob h" <omn### [at] charternet> wrote in message
news:3d0eda62$1@news.povray.org...
> sin(clock*pi)*TheFloatOrVector // use your own color float or vector
>
> Same could be put in as the transparency value instead, for the color map
> for example. You need to multiply the clock in that sin() by double number
> of times you want it to pulsate. So 8*clock equals 4 pulses.

Ahem! Please allow me to correct myself. The sin(clock*pi) doesn't go from 0
to 1 it instead goes from 0 to 1 and back to 0 again. And when clock is
greater than 1 it actually circulates into the negative, onward to -1 then
back to 0. In other words, sin(clock*0.5*pi) is 0 to 1, and sin(clock*3*pi)
is 0 to 1 (half) to 0 (one) to -1 to 0 (two) to 1 to 0 (three). Make sense?
;-)  I sure hope so, because I'm not even sure now. Okay, it is, I just
checked.

Sorry, it's not something I know by memory. Perhaps you know something of
math that I don't anyhow. Just trying to give my idea.

This means you'd have to either wrap abs() around it or compensate for the
negatives in another way, use another method, etcetera. Reason I say that is
probably obvious, negative color values usually aren't conducive for color
mapping and lights unless for some intended purpose.

bob h


Post a reply to this message

From: Chris Friedl
Subject: Re: Visible Light Rays
Date: 18 Jun 2002 08:17:10
Message: <3d0f24c6$1@news.povray.org>
Hi Bob

first of all thanks for the welcome. Only just beginning to discover the
world of Povray, even though I was aware of it for years. I've been stunned
by some of the awesome things people are doing with it that I've seen posted
in pbi and pba.

Thanks also for all the clues. I will certainly play with what you have
suggested because, as I'm new, I'm sure what I visualise in my mind will
take some hard work to get down into graphic bits and bytes. Not too scared
about the maths ... the scariest part is trying to remember what I learned
so long ago.

One other question related to pulsating (thought of this whilst watching
Spider-man at the movies tonight .... awesome movie) - is there a random
function that I could hook into the clock variable so that the pulsating
rays randonly got brighter/darker as the animation progressed? The Columbia
Pictures Lady with the shining torch who introduces so many movies got me
thinking because here torch shines variable brightness and variable
placement beams of light kind of like what I was imagining.

And, yes, I wouldn't mind any example code you could send my way. I find
disecting code a good way to learn basic ideas.

Be Well and Happy Always

Chris

"bob h" <omn### [at] charternet> wrote in message
news:3d0efc69@news.povray.org...
> "bob h" <omn### [at] charternet> wrote in message
> news:3d0eda62$1@news.povray.org...
> > sin(clock*pi)*TheFloatOrVector // use your own color float or vector
> >
> > Same could be put in as the transparency value instead, for the color
map
> > for example. You need to multiply the clock in that sin() by double
number
> > of times you want it to pulsate. So 8*clock equals 4 pulses.
>
> Ahem! Please allow me to correct myself. The sin(clock*pi) doesn't go from
0
> to 1 it instead goes from 0 to 1 and back to 0 again. And when clock is
> greater than 1 it actually circulates into the negative, onward to -1 then
> back to 0. In other words, sin(clock*0.5*pi) is 0 to 1, and
sin(clock*3*pi)
> is 0 to 1 (half) to 0 (one) to -1 to 0 (two) to 1 to 0 (three). Make
sense?
> ;-)  I sure hope so, because I'm not even sure now. Okay, it is, I just
> checked.
>
> Sorry, it's not something I know by memory. Perhaps you know something of
> math that I don't anyhow. Just trying to give my idea.
>
> This means you'd have to either wrap abs() around it or compensate for the
> negatives in another way, use another method, etcetera. Reason I say that
is
> probably obvious, negative color values usually aren't conducive for color
> mapping and lights unless for some intended purpose.
>
> bob h
>
>
>


Post a reply to this message

From: Xplo Eristotle
Subject: Re: Visible Light Rays
Date: 18 Jun 2002 15:55:22
Message: <3D0F904E.F4B0B42B@infomagic.net>
Chris Friedl wrote:
> 
> Just getting into POV now. I wanted to create "visible" light rays streaming
> from an object (do you ever actually see light itself?).

Light itself is the ONLY thing you ever actually see, unless you count
hallucinations, afterimages, and the like. ;)

> You know, like when
> the sun shines through a gap in the clouds. POV 3.5 beta6 shows an image of
> light through a window in the Insert>Special Effects>Atmospheric Media
> mouseover. I also want to animate to have an effect where the light stream
> intensity seems to increase and decrease. Sort of like a pulsating, brightly
> glowing object sitting in space.
> 
> Can anyone give me some clues on how to go about this?

"Media".

-Xplo


Post a reply to this message

From: Slime
Subject: Re: Visible Light Rays
Date: 18 Jun 2002 17:48:23
Message: <3d0faaa7$1@news.povray.org>
> (do you ever actually see light itself?)

You see color when light bounces off something towards you. Rays (like sun
through clouds) can create this effect when there are some sort of particles
in the air for them to bounce off of. Scattering media simulates this.
Beware, it can be frustrating; you may want to start with simple emitting
media first (which will not interact with light).

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: bob h
Subject: Re: Visible Light Rays
Date: 18 Jun 2002 22:12:02
Message: <3d0fe872@news.povray.org>
"Chris Friedl" <cfr### [at] bigpondnetau> wrote in message
news:3d0f24c6$1@news.povray.org...
>
> One other question related to pulsating (thought of this whilst watching
> Spider-man at the movies tonight .... awesome movie) - is there a random
> function that I could hook into the clock variable so that the pulsating
> rays randonly got brighter/darker as the animation progressed? The
Columbia
> Pictures Lady with the shining torch who introduces so many movies got me
> thinking because here torch shines variable brightness and variable
> placement beams of light kind of like what I was imagining.

The trick there is going to be getting beams of light to vary in length,
seemingly radiating away slowly. My guess would be using multiple media to
arrange that so each is doing something a little different. Perhaps even in
spherical patterns so the rays eminate into a variable density from out of
the source object.

Here's the example I had to show, added randomness:

// pulser (not pulsar)

camera {
  location  -9*z
  look_at   0
}

#declare Times=1; // number of cycles
#declare Pulse=abs(sin(clock*Times*pi));

#declare S=seed(321*clock); // make input value for random number
#declare R=rand(S); // get random number 0 to 1

union {

light_source {0,<1.5,1,.5>
         fade_distance .5+Pulse*2 // ray lengths
         fade_power 1+int(Pulse*2) // ray drop-off
}

sphere {0,10 // encapsulation of media "air"
pigment {
        checker color rgb .25 color rgb .5 scale 2 // rgbf 1
        }
        finish {ambient .5}
    interior {
        media {
            scattering {
                1, .1 // scatter amount of light (obscuration)
                extinction .1 // artificially brightened
            }
            density {
                rgb 1 // air thickness (also obscuration)
                }
        }
    }
 hollow
}

sphere {0,1 // the ray object
        pigment {
            bozo
                color_map {
    [.33+R*.33 color rgbt Pulse] // alternating opaque and clear over time
    [.33+R*.33 color rgbf <.1,.2,.9,1>*Pulse] // more solid, visible parts
                }
               // phase R*clock // shift pattern
                scale .25
                turbulence .25+R*.25 // shake up the pattern
        }
        finish {ambient Pulse}
}

} // union


Post a reply to this message

From: Chris Friedl
Subject: Re: Visible Light Rays
Date: 19 Jun 2002 01:00:51
Message: <3d101003@news.povray.org>
Hi Bob

I just created a short animation of your pulser example. It is just AWESOME.
It'll take me some time to completely understand what is happening but I can
definitely use it to get where I want to go. I'm just overwhelmed by your
generosity in sharing what you know with me. Wish the world was like this in
general.

Picked up the clock modifier from Chris Colefax too. Another brilliant piece
of work, especially being able to add clock types to produce, for example, a
wave clock with increasing frequency.

And found your media example. Cool. Plenty to keep this mind going for a
while.

Be Well and Happy Always

Chris


Post a reply to this message

From: bob h
Subject: Re: Visible Light Rays
Date: 19 Jun 2002 02:16:38
Message: <3d1021c6$1@news.povray.org>
"Chris Friedl" <cfr### [at] bigpondnetau> wrote in message
news:3d101003@news.povray.org...
>
> I just created a short animation of your pulser example. It is just
AWESOME.

Let's just call it pure luck, chance, irony that it turned out like anything
at all. Ha ha Thanks anyhow, appreciate knowing it was liked.

> It'll take me some time to completely understand what is happening but I
can
> definitely use it to get where I want to go. I'm just overwhelmed by your
> generosity in sharing what you know with me. Wish the world was like this
in
> general.

That might be some luck again  ;-)

> Picked up the clock modifier from Chris Colefax too. Another brilliant
piece
> of work, especially being able to add clock types to produce, for example,
a
> wave clock with increasing frequency.

Ack! I meant to have given the web address, I see I skipped it now that I've
reread what I wrote. Was probably going to add it to the end of the reply
and then forgot to. Glad you found it, an aging yet always useful thing.

Wandering off,
bob h


Post a reply to this message

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