POV-Ray : Newsgroups : povray.unofficial.patches : Getting Function Evaluation : Re: Getting Function Evaluation Server Time
1 Sep 2024 18:14:33 EDT (-0400)
  Re: Getting Function Evaluation  
From: Geoff Wedig
Date: 19 Dec 2000 13:22:02
Message: <3a3fa74a@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:

> In article <3a3f7c6f@news.povray.org>, Geoff Wedig 
> <wed### [at] darwinepbicwruedu> wrote:

>> What you wrote works, but if you have:
>> 
>> #declare test_function = function { Func }
>> 
>> eval_pattern(test_function, Pt)

> That won't work because you are just passing the function identifier. 
> The eval_pattern() function takes a *pattern*. Use this instead:
> eval_pattern(function {test_function(x, y, z)}, Pt)
> The "function {}" is necessary, because that is what tells POV it is a 
> function pattern.


> Oh, and a partial workaround for the range problem:
> #macro Eval_Func(Func, MaxRange, X, Y, Z)
>     eval_pattern(function {Func(x, y, z)/MaxRange}, < X, Y, Z>)*MaxRange
> #end

> A slightly more complex macro could be written to handle any range, you 
> just need to tell it what range your function will be using.

Aha!  Thanks, Chris.  You've managed to solve two major problems for me in
as many days.

Kudos.

Geoff


Post a reply to this message

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