POV-Ray : Newsgroups : povray.general : Gradient? Server Time
2 Nov 2024 01:21:23 EDT (-0400)
  Gradient? (Message 1 to 3 of 3)  
From: ingo
Subject: Gradient?
Date: 9 Jun 1999 16:44:51
Message: <375ed243@news.povray.org>
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?

ingo
--
Met dank aan de muze met het glazen oog.

#declare CamLoc=-15*z;
camera {
  location CamLoc
  look_at z
  angle 90
  orthographic
}

plane {
   -z,-100
   no_shadow
   pigment {
      gradient y
      scale 24
      pigment_map {
         [0.25, rgb 0]
         [0.25, rgb 1]
         [0.5 , rgb 1]
         [0.5 , gradient y]
      }
      translate <0,-12,0>
   }
   finish {ambient 1}
}


Post a reply to this message

From: Ron Parker
Subject: Re: Gradient?
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

From: ingo
Subject: Re: Gradient?
Date: 10 Jun 1999 04:36:42
Message: <375f791a@news.povray.org>
Ron Parker heeft geschreven in bericht <375ee0bd@news.povray.org>...

>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.


Obvious. I should have known this.

>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:

Ah, this is indeed what I'm looking for. I came from a situation with several
gradients. Then a strange circular thinking pattern keeps you from seeing the
simple solution :(

Thanks Ron.

ingo
--
Met dank aan de muze met het glazen oog.


Post a reply to this message

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