|
 |
Ken Cecka wrote:
>
> 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 also recently had this problem and managed it this way:
#declare rand_seed = seed(0)
#declare Rnd1 = rand(rand_seed)
#declare f1 = function { (x + Rnd1)^2 + y^2 + z^2 - 1 }
I think it's just a limitation of the isosurface parser, maybe it could be
changed, but this way works quite well.
Christoph
--
Christoph Hormann <chr### [at] gmx de>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
 |