POV-Ray : Newsgroups : povray.general : using an image_map for media density/color? : Re: using an image_map for media density/color? Server Time
1 Aug 2024 04:15:55 EDT (-0400)
  Re: using an image_map for media density/color?  
From: Bruno Cabasson
Date: 28 Mar 2006 02:45:01
Message: <web.4428e8b336d0704182fc96790@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> Hi, all!
>
> I'm trying to use an image_map to color some media in a transparent
> box--that is, "extruding" the image_map's colors in the +Z direction,
> "filling" the box from front to back with emitting (or scattering) media,
> the colors of which correspond to the image_map colors.  My image_map has
> an alpha channel as well (the idea being that the transparent parts of the
> image_map will create NO media density.)
>
> A recent post got me to thinking about this...
>
>
http://news.povray.org/povray.general/thread/%3Cweb.44174d8d9ca30044945ca8690%40news.povray.org%3E/
>
> I'm not even sure that what I'm attempting to do is possible; I've tried
> various ideas with no luck. Reading the POV docs in sections 3.5.11.15 and
> 16, I'm thinking that the image_map should first be turned into a pattern
> function(?)...  Like this:
>
> #declare my_pattern =
> function{
>  pigment{
>   image_map{png "my_image.png"
>     map_type 0
>     interpolate 2
>     once
>     }
>      }
>      }
>
> and then *trying* to apply it to an interior{media} statement,
> like this example (which doesn't work, and generates an error message):
>
> interior{
>  media{
>   emission .5
>   density{
>    my_pattern
>      }
>                       }
>            }
>
>
> Am I on the wrong track entirely? When I try to use the image_map itself in
> the media's density block, I get the error message, "image_map can only be
> used in a pigment statement."  Perhaps my image_map should instead be
> turned into a color_map somehow (?)
>
> I feel like I'm overlooking something obvious. Any help or suggestions would
> be most appreciated. This technique would be *very* useful.
>
> BTW, my_pattern works perfectly well when used properly as an isosurface
> function, so I'm at a loss as to why it isn't working in media.
>
> Ken

Hello!

AFAIK, an image_map is only defined in the x-y plane. So, I guess that using
it as a 3 dimensional pattern will lead to non-zero values only in that
plane, and therefore your density will be non-zero in an infinitely thin
slice of your container, ... which I am afraid will also be valuated to
zero.

   Regards.


Post a reply to this message

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