|
|
If I understand what you want, you want
to control the falloff in intensity of a spot of
pigment based on a radial-like function?
You can #declare functions with splines
to match your curve, then create a pattern function,
and a pigment using that function as a pattern.
For example...
// raw data
#declare data = function {
spline {
natural_spline
-0.2, 0.92,
0.0, 0.92,
0.1, 0.8,
0.2, 0.38,
0.25, 0.3,
0.3, 0.23,
0.4, 0.22,
0.5, 0.20,
0.6, 0.2,
0.8, 0.15,
0.9, 0.09
1.0, 0.07,
1.2, 0.09,
1.4, 0.15,
1.6, 0.15,
1.8, 0.15
}
};
// re-mapped data
#declare curve = function(A) {
data(A*1.6).x
};
// radial pattern based on curve
#declare rpat = function(x,y,z) {
abs(curve(atan(y/x)/360)*x*cos(atan(y/x))) +
abs(curve(atan(y/x)/360)*y*sin(atan(y/x))) + 0*z
};
// radial pigment based on curve and color map
#declare rpig = pigment {
function{ rpat(x,y,z)}
color_map {
[0 White]
[1 Black]
}
};
Post a reply to this message
|
|