POV-Ray : Newsgroups : povray.unofficial.patches : isosurface/function question : Re: isosurface/function question Server Time
1 Sep 2024 20:19:55 EDT (-0400)
  Re: isosurface/function question  
From: Christoph Hormann
Date: 10 Nov 2000 02:43:13
Message: <3A0BA711.DFFF0F86@schunter.etc.tu-bs.de>
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] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.