POV-Ray : Newsgroups : povray.general : Color function question Server Time
4 Aug 2024 02:18:54 EDT (-0400)
  Color function question (Message 1 to 5 of 5)  
From: d jarbee
Subject: Color function question
Date: 5 Sep 2003 19:40:01
Message: <web.3f591e9a75ce2c7d5d6ae59e0@news.povray.org>
Excuse me if this has been answered.
If I declare a function from an image map like so:

#declare Image = pigment{ image_map{ "goth.bmp" once} }
#declare f_Image = function{ pigment{Image} }

then use the function as a pigment:

plane{
        -z, 0
        pigment{ function{f_Image(x,y,z).gray} }
}

....it works but everywhere outside <0,0,0> to <1,1,0> on the plane is set to
a medium shade of gray. Am I doing something wrong?

Janger


Post a reply to this message

From: Slime
Subject: Re: Color function question
Date: 5 Sep 2003 19:50:31
Message: <3f592147$1@news.povray.org>
> ....it works but everywhere outside <0,0,0> to <1,1,0> on the plane is set
to
> a medium shade of gray. Am I doing something wrong?

That sounds like the correct behavior. Perhaps you didn't want to include
the "once" keyword?

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Hughes, B 
Subject: Re: Color function question
Date: 5 Sep 2003 22:59:10
Message: <3f594d7e@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote in message
news:3f592147$1@news.povray.org...
> > ....it works but everywhere outside <0,0,0> to <1,1,0> on the plane is
set
> to
> > a medium shade of gray. Am I doing something wrong?
>
> That sounds like the correct behavior. Perhaps you didn't want to include
> the "once" keyword?

If the idea was to place a single image onto the plane and leave the rest
transparent then I don't believe there's any way to do that in this way.
You'd need to clip away all areas surrounding the image or tell it to be
transparent. Neither can be done within a function pigment, FAIK anyway.

Checking on that here, what you see is actually white not gray. Use an
ambient 1 for the finish and you'll see. You can modify the pattern using
other functions or equations put in with the image function but that won't
remove parts, you still get a whole opaque plane. I tried combining a
transparent pigment and am not able to get just the image to show and leave
the rest empty.

Maybe someone else has more to say concerning this...?

Bob H.


Post a reply to this message

From: d jarbee
Subject: Re: Color function question
Date: 6 Sep 2003 18:10:01
Message: <web.3f5a5a8110dfa9b1b246b3750@news.povray.org>
Hughes, B. wrote:
>
>Checking on that here, what you see is actually white not gray. Use an
>ambient 1 for the finish and you'll see.


You are correct. Actually the camera was looking down slightly, so the white
looked more gray. For what I'm doing I could either apply the pigment to a
box, or use a 'picture frame' to mask out the white.

Thanks
Janger.


Post a reply to this message

From:
Subject: Re: Color function question
Date: 6 Sep 2003 18:47:52
Message: <3f5a6418$1@news.povray.org>
// What about something like this:


#declare Image = pigment{ image_map{ "goth.bmp" } }
#declare f_Image = function{ pigment{Image scale 2 translate <-1, -1, 0>} }

plane {
  -z, 0
  pigment{ boxed
    pigment_map {
      [ 0 color rgbt 1 ]
      [ 1E-5 function{f_Image(x,y,z).gray} ]
      }
    translate <1, 1, 0>
    scale 0.5
    }
  }

plane { -z, -1 pigment { bozo } }

light_source { <-2, 1, -3>, rgb 1 }
camera { location -3*z look_at 0 }


//   Sputnik


Post a reply to this message

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