In order to use a color scheme defined by a function,
we have to define a function that will produce a list of three numbers between 0 and 1.
Like the one below:
g := (x,y,z)->[abs(sin(x)), abs(sin(y)), abs(sin(z))]:
Now we can use it in our programs.
export(plot, Function3d):
g := (x,y,z)->[abs(sin(x)), abs(sin(y)), abs(sin(z))]:
f2 := Function3d(
cos(x*y),x=0..2*PI, y=0..2*PI,
Color = [Function, g]
):
plot(f2)
Obtained results can be quite impressive. The only
thing we have to remember - our color function shall
produce list of three real numbers and each of them shall
be from the interval [0, 1].
Published 19/04/2002; Updated on 09/06/03
, by M. L. Majewski