|
|
On 26/02/2012 0:30, ricky312 wrote:
> I am having trouble with function "looping" they go from rgb 0 to rgb 1 and
> repeat over again. is there a way to keep it from doing that with out dividing
> the function's "power".
> thank you in advance.
#declare noWrap=function(x) {max(min(x,1),0)}
//now you can do things like:
#declare repeatingFunction=function {x}
#declare nonRepeatingFunction=function{noWrap(repeatingFunction(x))}
//or, very usefull with pigment functions:
#declare troublesomeFunction=function {pigment {image_map {png
"yourpng.png" interpolate 2}}}
#declare
notSoTroublesomeFunction_Red=function{noWrap(troublesomeFunction(x,y,z).red)}
Hope this helps! Don't really know what you mean by "dividing the
function's power" though, so maybe this is of no use at all to you :)
--
ZK
Post a reply to this message
|
|
|
|
Zeger Knaepen <zeg### [at] povplacecom> wrote:
> On 26/02/2012 0:30, ricky312 wrote:
> > I am having trouble with function "looping" they go from rgb 0 to rgb 1 and
> > repeat over again. is there a way to keep it from doing that with out dividing
> > the function's "power".
> > thank you in advance.
>
>
> #declare noWrap=function(x) {max(min(x,1),0)}
>
> //now you can do things like:
>
> #declare repeatingFunction=function {x}
> #declare nonRepeatingFunction=function{noWrap(repeatingFunction(x))}
>
> //or, very usefull with pigment functions:
>
> #declare troublesomeFunction=function {pigment {image_map {png
> "yourpng.png" interpolate 2}}}
>
> #declare
> notSoTroublesomeFunction_Red=function{noWrap(troublesomeFunction(x,y,z).red)}
>
>
>
> Hope this helps! Don't really know what you mean by "dividing the
> function's power" though, so maybe this is of no use at all to you :)
> --
> ZK
Thank you so much; this works perfectly.
Post a reply to this message
|
|