POV-Ray : Newsgroups : povray.bugreports : Bug in functions (3.7) : Re: Bug in functions (3.7) Server Time
19 May 2024 13:34:33 EDT (-0400)
  Re: Bug in functions (3.7)  
From: Kenneth
Date: 9 Nov 2008 08:40:01
Message: <web.4916e71f3371f17d78dcad930@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> Sorry if this bug has been mentioned before.
>
> This works:
>
> #local Temp_function = function { f_sphere(x + 1, y + 1, z + 1, 1) }
>
> But this doesn't:
>
> #local Temp_var = <1,1,1,>;
> #local Temp_function = function { f_sphere(x + Temp_var.x, y + Temp_var.y, z +
> Temp_var.z, 1) }

You probably meant
#local Temp_var = <1,1,1>;

Actually, this doesn't work in 3.6.1c either, I've found. I'm just guessing
here, but I think it has to do with x and Temp_var.x being different kinds of
entities, which apparently can't be mixed together. Temp_var.x is a vector
quantity, whereas x (in a function) is...something else. :-)

BTW, using the function keyword (or not) has different, 'opposite' results,
depending on if x or Temp_var.x is used when making the function.  Kind of hard
to describe but here are some examples:
Given your original function...
#local Temp_function = function { f_sphere(x + 1, y + 1, z + 1, 1) }

This works (that is, it runs without a fatal error):
#local Temp_function_2 = function{Temp_function(x,y,z)}

but this doesn't...
#local Temp_function_2 = Temp_function(x,y,z);

Yet this works (though it probably doesn't mean much)...
#local Temp_var = <1,1,1>;
#local Temp_function_3 = Temp_function(Temp_var.x,Temp_var.y,Temp_var.z);

but this doesn't...
#local Temp_function_3 =
function{Temp_function(Temp_var.x,Temp_var.y,Temp_var.z)}

I'm sure there are reasons for this, but that's beyond me.

Ken W.


Post a reply to this message

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