|
![](/i/fill.gif) |
Hi all,
I've just started playing around with isosurfaces in MP0.6a, and have been
a little confused about what keywords are/aren't alowed when defining
functions. In particular, I wanted to use the rand() function, but I get
the error "float factor expected but rand found instead". As far as I
know, rand() returns a float factor, so this error doesn't make sense to
me. Are function expressions parsed differently than other pov code so
that they only allow a particular subset of the available functions?
Here's an example of what I'm struggling with:
#declare rand_seed = seed(0)
#declare f1 = function { (x + rand(rand_seed))^2 + y^2 + z^2 - 1 }
I would expect this to define a sphere of radius one positioned at a random
point between zero and one on the x-axis.
I've played around with noise3d(), which is an alternate solution, but
noise3d() appears to be similar to the bozo pattern where points which are
close together are less random than those far apart, and I am looking for a
way to get random positioning independent of proximity.
Thanks for your help.
Ken
P.S. Another question I had, which I am getting the impression is a
feature which is not yet avaiable, was how to define functions which accept
variables like the builtin functions do. Is this possible, or does have to
be done by building the function in a precompiled library?
Post a reply to this message
|
![](/i/fill.gif) |