POV-Ray : Newsgroups : povray.newusers : I Need Help With Media : Re: I Need Help With Media (small sample image) Server Time
30 Jul 2024 12:32:20 EDT (-0400)
  Re: I Need Help With Media (small sample image)  
From: Danny
Date: 17 May 2004 05:25:00
Message: <web.40a884af865d73e4ffb015460@news.povray.org>
Alain <aze### [at] qwertygov> wrote:
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
>   <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
>   <title></title>
> </head>
> <body vlink="#551a8b" alink="#ee0000" link="#0000ee" text="#330000"
>  bgcolor="#cccccc">
> Danny nous apporta ses lumieres ainsi en ce 2004/05/15 17:26... : <br>
> <blockquote cite="midweb.40a68af75c9adbfeffb015460@news.povray.org"
>  type="cite">
>   <pre wrap="">I'm trying to create a cylindrical laser that's white in the center,
fades
> to red, and then fades to nothing at the edges so that it has a fuzzy
> boundary.  I know I need to use media, but I don't know what any of the
> media terms do, so could anybody tell me which of them could help me?
>
>   </pre>
> </blockquote>
> Use a cylindrical pattern for your media enclosed in a long containing
> cylinder. Then, assign it a color_map, 1 for the center, 0 for the
> edge. It could look like this:<br>
> ///////////////////////////////////////////////<br>
> cylinder{0,1,<0,1000,0>,1 texture{pigment{rgbt 1}}//invisible
> enclosing shape<br>
>     interior{<br>
>         media {emission rgb 1 //make it an emissive,
luminous media<br>
>                  
   density{ cylindrical<br>
>                
        color_map{[0 rgb 0][0.5 rgb<1,0,0>][0.98
> rgb 1][1 rgb 2]}<br>
> // Nothing outside, fade to pure red at mid point then to white then
> double bright white at the very center<br>
>                 }<br>
>           }<br>
>        }<br>
>     hollow   // VERY IMPORTENT, if not present, the media
will disapears<br>
>     rotate<anglex,angley,anglez>// to orient your "beam" any
way
> you like<br>
>     translate<x,y,z> // to place it exactly where you want it
to
> go.<br>
>     }<br>
> ///////////////////////////////////////////////<br>
> By having one end of the shape at 0 make it easier to correctly orient
> and place it, it rotate around that point.<br>
> It should looks best using ratiosity, as it will effectively emit light.<br>
> <img height="90" width="144" alt=""
>  src="cid:par### [at] qwertygov"><br>
> Alain<br>
> </body>
> </html>

I used exactly what you told me, and I got a cylinder with white edges that
fades to nothing in the middle (without any red at all), and even those
white edges disappear as the cylinder continues on.  I'm using POV-Ray 3.5,
and here is the code I used:

cylinder{<100,0,0>,<0,0,0>, .20
         texture {
    pigment { color rgbt 1}
    finish{reflection 0}}
       interior{media{emission rgb 1
       density{ cylindrical
       color_map{[0 rgb 0][0.5 rgb<1,0,0>][0.98 rgb 1][1 rgb 2]}
       }}}
       hollow
       translate<0,0,2>
       }

Can you tell me what I'm doing wrong, and how to fix it?


Post a reply to this message

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