POV-Ray : Newsgroups : povray.general : merged (or nested) gradients : Re: merged (or nested) gradients Server Time
1 Aug 2024 18:26:46 EDT (-0400)
  Re: merged (or nested) gradients  
From: Mike Andrews
Date: 8 Jun 2005 12:15:01
Message: <web.42a7186922ca8993c717c9af0@news.povray.org>
Well, the way I'd do it is:-

// -- begin code --
cylinder { 0*y, 3*y, 1
  pigment {
    gradient y
    pigment_map {
      [0
        gradient x
        colour_map {
          [ 0.3 colour Red transmit 0.5]
          [ 0.5 colour White transmit 0.5]
          [ 0.7 colour Blue transmit 0.5]
        }
      ]
      [1
        gradient x
        colour_map {
          [ 0.3 colour Red transmit 1]
          [ 0.5 colour White transmit 1]
          [ 0.7 colour Blue transmit 1]
        }
      ]
    }
    scale <1,3,1>
  }
}
// -- end code --

Hope this helps,

Mike Andrews.

"Steely" <nomail@nomail> wrote:
> Hello.
>
> I am stuck over this :-( and any help will save my life! I need a texture
> that extends along one axis with a varying transparency along another axis.
> For example:
>
> cylinder { 0*y 3*y 1
>            pigment { gradient x
>                      color map { [ 0.3 Red]
>                                  [ 0.5 White]
>                                 [ 0.7 Blue] ... and so on.
>
> This should be merged with something like
>
> gradient y {
>             [ 0 transmit 0.5 ]
>             [ 1 transmit 1.0 ]
>
> So, the desired result is a cylinder with the colour bands along x, but
> increasing transparency along y - the cylinder "disappears" at the top.
>
> First, I expected it should be easy to get this, but meanwhile I tried
> EVERYthing I could think of, with no luck. I am still sure that it should
> be possible with two lines of code, and that I am -as many times- too
> close to see it.
>
> Thanks for any hint
>
> S.


Post a reply to this message

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