POV-Ray : Newsgroups : povray.general : Isosurface oddity : Isosurface oddity Server Time
30 Jul 2024 06:20:51 EDT (-0400)
  Isosurface oddity  
From: Doctor John
Date: 13 Jul 2009 10:23:28
Message: <4a5b4360@news.povray.org>
I've just come across an unusual bit of behaviour when rendering a large
number of similar isosurfaces.
When I use the code:
> #declare Index = 0;
> #while (Index<29)
> 	isosurface {
> 		function {f_rounded_box(x, y, z, 0.1, 1.19, 0.3, 0.4)+f_granite(x+rand(Seed),
>		y+rand(Seed), z+rand(Seed))*0.09}
I get the message:
> Parse Error: Expected 'function identifier', } found instead
However, when I use:
> #declare Index = 0;
> #while (Index<29)
> #local RX=rand(Seed);
> #local RY=rand(Seed);
> #local RZ=rand(Seed);
> 	isosurface {
> 		function {f_rounded_box(x, y, z, 0.1, 1.19, 0.3, 0.4)+f_granite(x+RX,
>		y+RY, z+RZ)*0.09}
Everything works as expected.
What's happening? Surely Pov's only got to look up the next number in
the random stream which can't be much different from looking up the
values of the declared variables.

John (scratching his head in confusion)
-- 
"Eppur si muove" - Galileo Galilei


Post a reply to this message

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