POV-Ray : Newsgroups : povray.general : Isosurface oddity : Re: Isosurface oddity Server Time
30 Jul 2024 06:23:28 EDT (-0400)
  Re: Isosurface oddity  
From: Doctor John
Date: 15 Jul 2009 06:21:26
Message: <4a5dada6@news.povray.org>
clipka wrote:
> 
> There's two answers to your question - a short one and a long one:
> 

When possible I always go for the long version.
Now I understand. :-)

> Speaking of macros: As a matter of fact, if you need this idiom (using
> rand()-generated values in a isosurface-defining function) frequently, you can
> save some of the work by defining a Rand() macro as follows:
> 
>     #macro Rand(stream)
>       #declare R = rand(stream);
>       R
>     #end
> 
> As macros are *always* evaluated at compile-time, and #declare statements are
> valid everywhere, you could now place the call anywhere, even in a function
> definition, without creating ambiguities or "misbehaving" functions.

Useful. Thanks for the help

John
-- 
"Eppur si muove" - Galileo Galilei


Post a reply to this message

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