POV-Ray : Newsgroups : povray.general : Gradient? : Re: Gradient? Server Time
11 Aug 2024 17:19:37 EDT (-0400)
  Re: Gradient?  
From: Ron Parker
Date: 9 Jun 1999 17:46:37
Message: <375ee0bd@news.povray.org>
On Wed, 9 Jun 1999 22:43:57 +0200, ingo wrote:
>In the scene below, I try to make a plane with the texture, first quarter black,
>second white and the tophalf is a gradient from black to white. Well, that's
>what I expected, but the top half shows a gradient form 50% to white. Why?
>(Tried the same setup with a texture_map, with the same result)
>How to get the result I want?

Try this instead:

      pigment_map {
         [0.25, rgb 0]
         [0.25, rgb 1]
         [0.5 , rgb 1]
         [0.5 , gradient y 
           color_map {
             [.5 rgb 0]
             [1 rgb 1]
           }
         ]
      }

The problem is that 'gradient y' maps the interval from y=0 to y=1
into the default color map, which is {[0 rgb 0][1 rgb 1]} for the gradient
pattern.  This happens even when the gradient is specified within a pigment
map.  This means that where y=.5, the color will be 50% gray.

There's an easier way to do this, too, if this result is really what you're
looking for and you haven't simplified it for the sake of debugging:

      pigment_map {
         [0.25, rgb 0]
         [0.25, rgb 1]
         [0.5 , rgb 1]
         [0.5 , rgb 0]
         [1.0 , rgb 1]
      }


Post a reply to this message

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