POV-Ray : Newsgroups : povray.unofficial.patches : Getting Function Evaluation : Re: Getting Function Evaluation Server Time
1 Sep 2024 18:14:46 EDT (-0400)
  Re: Getting Function Evaluation  
From: Chris Huff
Date: 19 Dec 2000 12:16:04
Message: <chrishuff-B74F01.12171019122000@news.povray.org>
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.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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