POV-Ray : Newsgroups : povray.newusers : I Need Help With Media : Re: I Need Help With Media (small sample image) Server Time
30 Jul 2024 18:21:29 EDT (-0400)
  Re: I Need Help With Media (small sample image)  
From: Danny
Date: 27 May 2004 23:05:01
Message: <web.40b6ac4e865d73e4ffb015460@news.povray.org>
Alain <aze### [at] qwertygov> wrote:
> Danny nous apporta ses lumieres ainsi en ce 2004/05/21 16:22... :
>
> > <snip>
> >
> >
> >Is this cylinder light_source supposed to produce a visible light beam that
> >can be seen outside where it's pointing at, or is it more like a laser pen
> >that produces a dot on the surface it's aimed at? I tried it along with
> >scattering and it did nothing to get rid of the images.
> >Also, in order to round off the ends of my laser beam, I put some
> >half-spheres on either end, both filled with the same media, except the
> >density is spherical instead of cylindrical.  For some reason, this created
> >tons more problems.  When you look at the half-spheres perpendicularly,
> >there's no problem, but when you look at them obliquely, you get very odd
> >results, such as grey rings, spots, etc.  Here's what I'm doing:
> >
> >
> >
> Why do you use this default texture, it's the source of most of your
> problems
>
> > #default {
> >   texture {
> >  pigment {Grey}
> >    finish {
> >     diffuse 0.6
> >      ior 1.5
> >      ambient 0.300000
> >      phong 0.5
> >      phong_size 50
> >}
> >}}
> >
> >
> >camera {
> >  location <0,0.5,2>
> >  look_at <0,0.5,0>
> >}
> >
> >background {color rgb <0,0,0>}
> >
> >light_source {
> >  <-1000.000000,1000.000000,1000.000000>       //  x=-1000,y=1000,z=1000
> >  color rgb <1.0000,1.0000,1.0000>
> >           }
> >
> >#declare clock1=1;
> >
> >union{
> >cylinder{<0,2*clock1,0>,<0,0,0>, 1                 //the laser, top right
> >from front
> >         texture {
> >    pigment { color rgbt 1}}
> >       interior{media{emission rgb 1
> >       density{ cylindrical
> >       color_map{[0 rgb 0][0.03 rgb <0.0004,0,0>][0.6 rgb<8,0,0>][0.98 rgb
> >16][1 rgb 30]} //[0 rgb 0][0.02 rgb <0.004,0,0>][0.5 rgb<4,0,0>][0.96 rgb
> >5][1 rgb 10]
> >       }}}
> >       hollow
> >       scale<0.1, 1, 0.1>
> >       }
> >
> >
> removing this don't change anything in your cene
>
> >difference{
> >sphere{<0,0,0>, 1
> >         texture {
> >    pigment { color rgbt 1}}
> >       interior{media{emission rgb 1
> >       scattering{3,1}
> >       density{ spherical
> >       color_map{[0 rgb 0][0.03 rgb <0.0004,0,0>][0.6 rgb<8,0,0>][0.98 rgb
> >16][1 rgb 30]}
> >       }}}
> >       hollow
> >       scale<0.1, 0.1, 0.1>
> >       translate <0,2*clock1,0>
> >       }
> >cylinder{<0,2*clock1,0>,<0,0,0>,5}
> >       }
> >
> >
> -----------------------------------------------------------------
>
> >difference{
> >sphere{<0,0,0>, 1
> >         texture {
> >    pigment { color rgbt 1}}
> >       interior{media{emission rgb 1
> >       density{ spherical
> >       color_map{[0 rgb 0][0.03 rgb <0.0004,0,0>][0.6 rgb<8,0,0>][0.98 rgb
> >16][1 rgb 30]}
> >       }}}
> >       hollow
> >       scale<0.1, 0.1, 0.1>
> >       }
> >cylinder{<0,5,0>,<0,0,0>,5}
> >        }
> >light_source{0 rgb 10 cylinder point_at y*2}
> >}
> >
> >sphere{<.2,.5,-.5>,0.1}
> >
> >
> >Try running this and you'll see the image of the sphere on the laser.
> >
> >
> Default ior applied to the cylinder
>
> >You'll also see the grey ring where the laser cylinder and the laser
> >half-sphere meet(try looking at that location perpendicularly and the grey
> >ring disappears).
> >
> >
> Default texture applied to the substracting cylinder
>
> >You can also see a small white dot on the bottom half-sphere, which is also
> >an image of the grey sphere.
> >
> Default texture's ior again
>
> > I have a background of stars, and so the ends
> >of my laser end up looking speckled.  How can I make all those images and
> >grey rings go away?
> >
> >
> >
> 1- Remove the ior statement in your default. Thin add an ior to your
> cylinder, this is what cause the sphere to apears in your beam.
> 2- Use merge instead on an union. This will remove the internal surfaces.
> 3- Use difference{sphere{...}cylinder{...}texture{...}interior{...}}.
> That is, apply the texture and interior to the whole
> union/difference/intersection/merge. The cylinder get the default
> texture and apply it to where it intercect the sphere, giving you that
> gray circle.
>
> Alain


Thanks, Alain, all the images on the laser are gone now that ior has been
deleted. It also helped by making the outer edge fuzzier.  However, I'm
still having problems with the grey circle. This time, instead of a grey
circle, there's a disk that matches the color of the media (white in the
middle, red on the outside), but a little wider than the laser so it
doesn't match up (probably b/c removing the ior also seemed to shrink the
laser's width a little). Is this what you wanted me to do:

merge{
cylinder{<0,2*clock1,0>,<0,0,0>, 1                 //the laser, top right
         texture {
    pigment { color rgbt 1}}
       interior{media{emission rgb 1
       density{ cylindrical
       color_map{[0 rgb 0][0.03 rgb <0.0004,0,0>][0.6 rgb<8,0,0>][0.98 rgb
16][1 rgb 30]}
       }}}
       hollow
       scale<0.1, 1, 0.1>
       }

difference{
sphere{<0,0,0>, 1}
cylinder{<0,5,0>,<0,0,0>,5}

         texture {
    pigment { color rgbt 1}}
       interior{media{emission rgb 1
       density{ spherical
       color_map{[0 rgb 0][0.03 rgb <0.0004,0,0>][0.6 rgb<8,0,0>][0.98 rgb
16][1 rgb 30]}
       }}}
       hollow
       scale<0.1, 0.1, 0.1>
          }
}


Post a reply to this message

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