POV-Ray : Newsgroups : povray.advanced-users : Implicit loops in function(x,y,z) : Re: Implicit loops in function(x,y,z) Server Time
5 Jul 2024 14:58:36 EDT (-0400)
  Re: Implicit loops in function(x,y,z)  
From: Mike Williams
Date: 28 Sep 2008 16:12:49
Message: <YW$5yiA1P+3IFwhT@econym.demon.co.uk>
Wasn't it CoucouHibou who wrote:
>Hi all,
>
>after some research, I finally found this discussion which talks about
>a subject
>very close to my problem.
>
>I am currently trying to generate a function that interpolates the values of a
>physical parameter from a 3-dimensional array. I have the same kind of error
>message as what has been posted here, when I use the following code (my array
>is named SapceSample, and it has nx*ny*nz elements):
>
>#declare ExtrapFunc=function(px,py,pz){
>
>.... SpaceSample[floor(px)[floor(py)][floor(pz)] ...;
>
>}
>
>The error message is:
>
>Parse Error: ... undeclared identifier 'px'.
>
>So I suppose that when POV-Ray hits the '[', it goes back to the SDL language,
>as Warp explained in message #4.

Arrays are always evaluated at parse time, whereas px is only meaningful
at run time.

Inside functions, all you can do with arrays is things like this:
  http://www.econym.demon.co.uk/isotut/arrays.htm

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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