|
![](/i/fill.gif) |
William Tracy <wtr### [at] calpoly edu> wrote:
> Okay. I'm newly returning to Pov, and this is a stupid simple question,
> so I figure I can post this under "new users". :-P
>
> I can create a user-defined function from a pigment. Is it possible to
> create a pigment from a function? The documentation isn't clear to me,
> but seems to say "no".
You can use a function as a pattern (see "3.5.11.15 Function as pattern") and
therefore, in some sense, as a pigment; however, to use a *pigment* function as
a pigment again, preserving all colors, you will probably have to do some
trickery, like:
pigment {
average
pigment_map {
[ 1
function { myFunc(x,y,z).red }
color_map {
[ 0 color red*0 ]
[ 1 color red*3 ]
}
]
[ 1
function { myFunc(x,y,z).green }
color_map {
[ 0 color green*0 ]
[ 1 color green*3 ]
}
]
[ 1
function { myFunc(x,y,z).blue }
color_map {
[ 0 color blue*0 ]
[ 1 color blue*3 ]
}
]
}
}
Post a reply to this message
|
![](/i/fill.gif) |