POV-Ray : Newsgroups : povray.binaries.images : Re: Temple of Greed - WIP Server Time
13 Nov 2024 07:24:54 EST (-0500)
  Re: Temple of Greed - WIP (Message 1 to 1 of 1)  
From: Cousin Ricky
Subject: Re: Temple of Greed - WIP
Date: 9 Nov 2004 19:05:00
Message: <web.41915836f04b350a43a5e2560@news.povray.org>
JS <no### [at] spammersallowed> wrote:
> BTW. I got a very nasty surprise, trying to use my planet generator macro
> to produce the ball. The macro defines a function, which takes parameter
> called "x1", but this causes Povray to complain, since the context in
> which the macro is included has a local variable x1. Is there any way
> around this (no, renaming the parameter or variable is not an option,
> since there would be a new conflict sooner or later) and should this be
> reported as a bug ?
>
> The bug comes out in situations like this:
>
> #macro planet(rseed, atmo, clouds, lights, dayvector)
> #local vangle = function(x1,y1,z1,x2,y2,z2) { <-- Povray exits with error}
> #end
>
> #declare temple = union {
> #local x1 = 0;
> #include planet(4,0,1,1,<0,10,0>)
> }

I don't see it so much as a bug as one of POV-Ray's parsing quirks.  The way
i deal with it is to prefix all my function arguments with P0_, P1_, P2_,
etc, with the understanding that names of this format shall be reserved to
function arguments.  Thus, your function declaration would be something
like:

#local vangle = function (P0_x1, P1_y1, P2_z1, P3_x2, P4_y2, P5_z2) { ... }

Names of this format would not be used in any other contexts.

Should you report it as a bug?  I myself have grudgingly filed this one
under http://www.povray.org/documentation/view/3.6.1/713/, "I don't like
the way this works so it must be a bug."  You might want to consider it as a
feature request.


Post a reply to this message

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