POV-Ray : Newsgroups : povray.general : trouble using rand inside of sine function : Re: trouble using rand inside of sine function Server Time
30 Jul 2024 14:19:21 EDT (-0400)
  Re: trouble using rand inside of sine function  
From: clipka
Date: 4 Dec 2008 17:45:00
Message: <web.49385c92e3dfa9ccf5dae140@news.povray.org>
"Mike" <win### [at] hotmailcom> wrote:
> I am doing:
> #declare R1=seed(1153);
> #declare xspectrum =function{ sin  ( x+  rand(R1)   )    }
>
> but it does not work.

Unfortunately, only a subset of float expressions is supported in function
definitions. The rand() built-in function doesn't seem to be one of them.

You will have to find some other way.

How about a "noisy" pattern function, e.g.:

#declare myRand = function { pattern { bozo } }
#declare xspectrum = function { sin ( x + myRand(x,y,z) ) }

would this help you, maybe with a lot of turbulence added to the pattern?


Post a reply to this message

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