|
|
In article <3d58fd40@news.povray.org> , "jansb000" <jan### [at] planetnl>
wrote:
> #declare my_circle_centre = <1.1, 2.2, 3.3>;
> #declare my_fun =
> function(v) {
> my_circle_centre.x + v
> }
> // my_circle_centre.x is not recognised as a float.
>
> I think that my_circle_centre.x should be treated as a float.
No, this is a cureent design limitation that cannot easily be eliminated
completely in 3.5 but will go away in POV-Ray 4.0.
For now, use casting, i.e. like this will help:
#macro Const(theconst)
#local retconst = theconst;
retconst
#end
#declare my_fun = function(v)
{
Const(my_circle_centre.x) + v
}
Just like the other solutions proposed in this thread it will parse a bit
slower but have no (negative) effect on the function's speed.
Thorsten
____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg
I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
|