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:17:18 EDT (-0400)
  Re: using an image_map for media density/color?  
From: Bruno Cabasson
Date: 28 Mar 2006 03:40:01
Message: <web.4428f64e36d0704182fc96790@news.povray.org>
"Bruno Cabasson" <bru### [at] alcatelaleniaspacefr> wrote:
> "Bruno Cabasson" <bru### [at] alcatelaleniaspacefr> wrote:
>
> > 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.
>
> Ooops! not 100% awake this morning ... My reply was not very smart ...
> Forget it. Mike's is much more sensible ...

I had a cofee and my brain functions a little now ;)

This piece of code works:

#declare my_pattern = function
{
    pigment
    {
        image_map
        {
            png "my_image.png"
            map_type 0
            interpolate 2
            once
        }
    }
}

box
{
    0, 1
    pigment {rgbt 1}
    hollow
    interior
    {
        media
        {
            emission Red
            density {function  {my_pattern(x,y,z).red}}
        }
        media
        {
            emission Green
            density {function  {my_pattern(x,y,z).green}}
        }
        media
        {
            emission Blue
            density {function  {my_pattern(x,y,z).blue}}
        }
    }
}

Regards


Post a reply to this message

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