POV-Ray : Newsgroups : povray.advanced-users : Texture transition : Re: Texture transition Server Time
29 Jul 2024 00:27:46 EDT (-0400)
  Re: Texture transition  
From: Christopher James Huff
Date: 1 Jun 2003 21:35:31
Message: <cjameshuff-FABF6D.20280201062003@netplex.aussie.org>
In article <3eda6530@news.povray.org>,
 "Andrew Coppin" <orp### [at] btinternetcom> wrote:

> What I want is for all points where y >= +100 to be red, all points where y
> <= -100 to be blue, and the points inbetween to be linearly interpolated. I
> can get red -> blue -> red, and I can get blue -> red -> blue, but how do I
> get red -> blue?

You could use the object pattern with a plane to remove the undesired 
portion. Something like:

pigment {
    object {plane {y, 0}
        pigment {color Red},
        pigment {planar
            color_map {[0 color Blue] [1 color Red]}
        }
    }
}

I've been thinking of a generalization of the waveform feature that 
would make this a lot easier, it would be done with a gradient pattern 
and a clamp waveform.

You could also do it with a simple function pattern:

#include "math.inc"

pigment {function {clip(y, 0, 1)}
    color_map {[0 color Red] [1 color Blue]}
}

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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