POV-Ray : Newsgroups : povray.text.scene-files : Rainbow lightbeam? Server Time
29 Oct 2024 22:45:20 EDT (-0400)
  Rainbow lightbeam? (Message 1 to 5 of 5)  
From: Gary Cramblitt
Subject: Rainbow lightbeam?
Date: 18 Sep 2001 22:47:37
Message: <Xns9120E7AF3E32Bgarycramblittknilhtr@204.213.191.226>
Can someone post some code to produce a conical light beam in rainbow 
colors.  A beam one might see coming from a prism, for example,  Note: not a 
light source; a beam using scattering or emitting media.  For Win PovRay 
3.1a.  Thanks.


Post a reply to this message

From: Bob H 
Subject: Re: Rainbow lightbeam? Yes
Date: 19 Sep 2001 03:44:45
Message: <3ba84ced@news.povray.org>
/*
 Here's a quick try at it.  If you use a cone instead of the box the thin
edges won't look right, I can tell you that without even having tried it in
this.  At least not without first narrowing its thickness.  In fact this one
doesn't look very spectrum like when oriented away from the camera.
 This should be okay for POV-Ray 3.1
 You'll need to work out the layout from what's in the comments and object
transformations in order to use it in other ways of your own.
*/

// example of faked light spectrum from a prism

#declare Scale=5; // overall size
#declare Illum=2; // brightness

// prism paired with spectrum
union {

// prism
intersection {
        plane {x,.1}
        plane {x,.1 rotate 120*y}
        plane {x,.1 rotate 240*y}
        plane {-y,0}
        plane {+y,1}
 pigment {rgbf <0.8,1,0.9,1>}
 interior {ior 1.5}
   rotate -45*y scale <0.75,1,0.5> translate <-0.025,0,-0.025>
}

// media spectrum
box {0,1 hollow
        pigment {rgbt 1}
        interior {
                media {
                        emission 1
                       density { radial frequency 4
                         density_map {
                                [0 rgb <0,0,0>]
                                [0.1 rgb <1,0,0>*Illum/Scale]
                                [0.3 rgb <1,0.5,0>*Illum/Scale]
                                [0.4 rgb <1,1,0>*Illum/Scale]
                                [0.7 rgb <0,1,0>*Illum/Scale]
                                [0.85 rgb <0,1,1>*Illum/Scale]
                                [0.9 rgb <0,0,1>*Illum/Scale]
                                [1 rgb <0,0,0>]
                         }
                        }
                }
                media {
                        absorption 1
                       density { radial frequency 4
                         density_map {
                                [0 rgb <0,0,0>] // adjust colors to liking
                                [0.1 rgb <1,0,0>*Illum/Scale]
                                [0.3 rgb <1,0.5,0>*Illum/Scale]
                                [0.4 rgb <1,1,0>*Illum/Scale]
                                [0.7 rgb <0,1,0>*Illum/Scale]
                                [0.85 rgb <0,1,1>*Illum/Scale]
                                [0.9 rgb <0,0,1>*Illum/Scale]
                                [1 rgb <0,0,0>]
                         }
                        }
                }
        }
}
 rotate 45*y scale <2,1,1>*Scale

  rotate -42*x // -45 to align with camera as is (perpendicular)
}
// end spectrum

light_source {
        0,0.5
}

camera {
        location <0,0,-10>
        look_at <2,0.5,0.5>
        angle 30
        rotate 42*x // +45 to be opposite the wedges upper face when as
above
}

// room
box {-15,15
        pigment {rgb 0.9}
        finish {ambient 0.1}
 inverse
}


Post a reply to this message

From: blessing
Subject: Re: Rainbow lightbeam? Yes
Date: 19 Sep 2001 07:36:59
Message: <3ba8835b@news.povray.org>
hey thats cool!

I'm still amazed at the thing people can make this program do.
Gary

Bob H. <omn### [at] msncom> wrote in message
news:3ba84ced@news.povray.org...
> /*
>  Here's a quick try at it.  If you use a cone instead of the box the thin
> edges won't look right, I can tell you that without even having tried it
in
> this.  At least not without first narrowing its thickness.  In fact this
one
> doesn't look very spectrum like when oriented away from the camera.
>  This should be okay for POV-Ray 3.1
>  You'll need to work out the layout from what's in the comments and object
> transformations in order to use it in other ways of your own.
> */
>
> // example of faked light spectrum from a prism
>
> #declare Scale=5; // overall size
> #declare Illum=2; // brightness
>
> // prism paired with spectrum
> union {
>
> // prism
> intersection {
>         plane {x,.1}
>         plane {x,.1 rotate 120*y}
>         plane {x,.1 rotate 240*y}
>         plane {-y,0}
>         plane {+y,1}
>  pigment {rgbf <0.8,1,0.9,1>}
>  interior {ior 1.5}
>    rotate -45*y scale <0.75,1,0.5> translate <-0.025,0,-0.025>
> }
>
> // media spectrum
> box {0,1 hollow
>         pigment {rgbt 1}
>         interior {
>                 media {
>                         emission 1
>                        density { radial frequency 4
>                          density_map {
>                                 [0 rgb <0,0,0>]
>                                 [0.1 rgb <1,0,0>*Illum/Scale]
>                                 [0.3 rgb <1,0.5,0>*Illum/Scale]
>                                 [0.4 rgb <1,1,0>*Illum/Scale]
>                                 [0.7 rgb <0,1,0>*Illum/Scale]
>                                 [0.85 rgb <0,1,1>*Illum/Scale]
>                                 [0.9 rgb <0,0,1>*Illum/Scale]
>                                 [1 rgb <0,0,0>]
>                          }
>                         }
>                 }
>                 media {
>                         absorption 1
>                        density { radial frequency 4
>                          density_map {
>                                 [0 rgb <0,0,0>] // adjust colors to liking
>                                 [0.1 rgb <1,0,0>*Illum/Scale]
>                                 [0.3 rgb <1,0.5,0>*Illum/Scale]
>                                 [0.4 rgb <1,1,0>*Illum/Scale]
>                                 [0.7 rgb <0,1,0>*Illum/Scale]
>                                 [0.85 rgb <0,1,1>*Illum/Scale]
>                                 [0.9 rgb <0,0,1>*Illum/Scale]
>                                 [1 rgb <0,0,0>]
>                          }
>                         }
>                 }
>         }
> }
>  rotate 45*y scale <2,1,1>*Scale
>
>   rotate -42*x // -45 to align with camera as is (perpendicular)
> }
> // end spectrum
>
> light_source {
>         0,0.5
> }
>
> camera {
>         location <0,0,-10>
>         look_at <2,0.5,0.5>
>         angle 30
>         rotate 42*x // +45 to be opposite the wedges upper face when as
> above
> }
>
> // room
> box {-15,15
>         pigment {rgb 0.9}
>         finish {ambient 0.1}
>  inverse
> }
>
>
>


Post a reply to this message

From: Gary Cramblitt
Subject: Re: Rainbow lightbeam? Yes
Date: 19 Sep 2001 21:02:19
Message: <Xns9121D5D29C23Fgarycramblittknilhtr@204.213.191.226>
Right on Bob! Just what I needed.  Thanks.

"Bob H." <omn### [at] msncom> wrote in news:3ba84ced@news.povray.org:

> /*
>  Here's a quick try at it.  If you use a cone instead of the box the


Post a reply to this message

From: Bob H 
Subject: Re: Rainbow lightbeam? Yes
Date: 20 Sep 2001 02:56:42
Message: <3ba9932a@news.povray.org>
Welcome to it.  If I didn't have the help of everyone else myself it
wouldn't be as possible  :-)

Bob H.

"Gary Cramblitt" <NOS### [at] Homecom> wrote in message
news:Xns### [at] 204213191226...
> Right on Bob! Just what I needed.  Thanks.


Post a reply to this message

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