|
 |
Chris Huff <chr### [at] mac com> wrote:
> In article <3a3e0bb8@news.povray.org>, Geoff Wedig
> <wed### [at] darwin epbi cwru edu> wrote:
>> No, it gave me an error. I don't have the code here, so I can't tell
>> what error it was, but once I saw that, I began to wonder what
>> eval_pattern() was for in the first place, since it wasn't for that.
> The eval_pattern() function returns the float value of a pattern at a
> specific point...for a function pattern, this should be the result of
> evaluating the function at that point, at least as long as the result is
> in the 0-1 range and you don't have any special waveforms,
> transformations, or warps applied. If you post the problem code I will
> try to figure out what's wrong...
> Something like this macro *should* work for most cases:
> #macro Eval_Func(Func, X, Y, Z)
> eval_pattern(function {Func}, < X, Y, Z>)
> #end
> Of course, that could also be written:
> #macro Eval_Func(Func, Pt)
> eval_pattern(function {Func}, Pt)
> #end
> Where Pt is a 3D vector.
What you wrote works, but if you have:
#declare test_function = function { Func }
eval_pattern(test_function, Pt)
I get the following: "error: numeric expression expected but func_id found
instead."
So it sortof works.
Geoff
Post a reply to this message
|
 |