POV-Ray : Newsgroups : povray.general : merged (or nested) gradients Server Time
31 Oct 2024 19:26:55 EDT (-0400)
  merged (or nested) gradients (Message 1 to 4 of 4)  
From: Steely
Subject: merged (or nested) gradients
Date: 8 Jun 2005 11:45:00
Message: <web.42a71116fa3631b1e973d3470@news.povray.org>
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

From: Mike Andrews
Subject: Re: merged (or nested) gradients
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

From: Steely
Subject: Re: merged (or nested) gradients
Date: 8 Jun 2005 13:25:00
Message: <web.42a728c922ca8993e973d3470@news.povray.org>
"Mike Andrews" <nomail@nomail> wrote:
> Well, the way I'd do it is:-
>
> // -- begin code --
>     pigment_map {
      ^^^^^^^^^^^^^^




Any other ideas?

TIA

S.


Post a reply to this message

From: Alain
Subject: Re: merged (or nested) gradients
Date: 8 Jun 2005 17:43:47
Message: <42a76693$1@news.povray.org>
Steely nous apporta ses lumieres en ce 2005-06-08 13:21:
> "Mike Andrews" <nomail@nomail> wrote:
> 
>>Well, the way I'd do it is:-
>>
>>// -- begin code --
>>    pigment_map {
> 
>       ^^^^^^^^^^^^^^
> 


> 
> Any other ideas?
> 
> TIA
> 
> S.
> 
> 
> 
Been in a media, the solution is simple: use 2 densitys in the same media. The
densitys will 
multiplied together. If one density return zero, it will cancel the other.
Read 3.6.2.3.4  Multiple Density vs. Multiple Media in the documentation.

So,
       media {
         density { gradient y }
         density { your horizontal density_map }
       }
Hope this will help you

Alain


Post a reply to this message

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