POV-Ray : Newsgroups : povray.general : using an image_map for media density/color? : using an image_map for media density/color? Server Time
1 Aug 2024 04:11:23 EDT (-0400)
  using an image_map for media density/color?  
From: Kenneth
Date: 28 Mar 2006 00:15:00
Message: <web.4428c5d859cea9017bf568ef0@news.povray.org>
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


Post a reply to this message

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