|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> While working on the glory feature that CR posted, it (re)occurred to me that
> having some sort of "flag" to jimmy function / color map behaviour would be a
> useful thing.
>
> I need to absolutely exclude certain inputs to my texture / color_map, and with
> pov-ray's value-wrapping, and real-valued function results, I find myself
> spending a lot of time trying to do clever things to use values to signify that
> I want to do things "off to the side" of what the main function is doing.
> Because I'm stuck using a mathematical function, not a macro or algorithm -
> which some languages refer to as "functions".
>
> What I'm wondering is if there's a (future) way to set the result of a function
> like select () to NAN, i, or some other "orthogonal placeholder" that a
> color_map would just "ignore" and maybe set to something like rgbft1.
So, an interesting idea occurred to me.
We can have discontinuous color_maps with duplicate entries specifying cusps.
So how do the values at those cusps get evaluated?
I designed a color_map and a function {pigment {}} to test this.
#declare Gradient =
pigment {
gradient x
color_map {
[0.00 rgbt 1]
[0.00 rgb 0]
[0.33 rgb x]
[0.50 rgb x]
[0.50 rgbt 1]
[0.50 rgb y]
[0.66 rgb y]
[1.00 rgb z]
[1.00 rgbt 1]
}
}
#declare fG = function {pigment {Gradient}}
Results:
Val(val("-inf")) = 0.000, 1.000, 0.000, 0.000, 0.000 [huh?]
Val(-0) = 1.000, 1.000, 1.000, 0.000, 1.000
Val(0) = 1.000, 1.000, 1.000, 0.000, 1.000
Val(+0) = 1.000, 1.000, 1.000, 0.000, 1.000
Val(E) = 0.000, 0.000, 0.000, 0.000, 0.000
Val(0.5-E) = 1.000, 0.000, 0.000, 0.000, 0.000
Val(0.5) = 1.000, 0.000, 0.000, 0.000, 0.000
Val(0.5+E) = 0.000, 1.000, 0.000, 0.000, 0.000
Val(1-E) = 0.000, 0.000, 1.000, 0.000, 0.000
Val(-0+1) = 1.000, 1.000, 1.000, 0.000, 1.000
Val(1) = 1.000, 1.000, 1.000, 0.000, 1.000
Val(+0+1) = 1.000, 1.000, 1.000, 0.000, 1.000
Val(val("nan")) = 1.000, 1.000, 1.000, 0.000, 1.000
Val(val("+inf")) = 1.000, 1.000, 1.000, 0.000, 1.000
Some useful things, plus a puzzling one to think about / decipher in source.
- BE
Post a reply to this message
Attachments:
Download 'colormapvaluetest.pov.txt' (2 KB)
|
 |