 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I'd really like it if PovRay had assignment operators,
so that it would know the difference between declaring
a variable and assigning a value to an existing one. It
would, in my case, signal a typo for the multitude of
variables used in some of my code. I like to declare
the default variables and then change them as needed
prior to calling macros.
#declare gl_XposAtMaxVelocity = 1.45;
later in the code:
#assign gl_XPosAtMaxVelocity = 2.00;
Then PovRay would check the existence of the previously
declared variable and issue a warning that the variable
does not exist. In the example above, I have a capital 'P'
where it should be lower case.
Currently, PovRay just creates the new variable and the
macro continues to use the old value and it's sometimes
difficult to find the error.
Just wishing...
Thanks again for making such a wonderful program!
=Bob=
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
=Bob= <Bob### [at] threestrands com> wrote:
> I'd really like it if PovRay had assignment operators,
> so that it would know the difference between declaring
> a variable and assigning a value to an existing one. It
> would, in my case, signal a typo for the multitude of
> variables used in some of my code. I like to declare
> the default variables and then change them as needed
> prior to calling macros.
>
> #declare gl_XposAtMaxVelocity = 1.45;
>
> later in the code:
>
> #assign gl_XPosAtMaxVelocity = 2.00;
>
> Then PovRay would check the existence of the previously
> declared variable and issue a warning that the variable
> does not exist. In the example above, I have a capital 'P'
> where it should be lower case.
>
> Currently, PovRay just creates the new variable and the
> macro continues to use the old value and it's sometimes
> difficult to find the error.
Why patch POV when you can do it with macros?:
#macro assign (Var, Value) #declare Var = Value; #end
Usage:
#declare gl_XposAtMaxVelocity = 1.45;
assign (gl_XposAtMaxVelocity, 2.00)
This should behave exactly as you want, issuing a warning when you try to
assign a value to a non-defined variable (and even showing you the mistyped
variable name!).
If you want to go one step further, you can create macros that allow you to
use named options with macro functions (so you don't have to declare/assign
all the options you want to use) - see my Spline Macro File at
http://www.geocities.com/ccolefax/spline for details.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Hi Chris,
I was going to add in my post that a macro would
suffice to do the job, but I left it off as I was doing
three things at once. I do appreciate your solution
to my need, and will probably implement something
of the sort. It's just that it does puff up the code
quite a bit when you use hundreds of variables, and
the interpreter could do the job so much faster. Maybe
not as much as I think?
Thanks again, wishing you a wonderful evening!
=Bob=
"Chris Colefax" <chr### [at] tag povray org> wrote in message
news:3a29b642@news.povray.org...
[My post and solution deleted]
: This should behave exactly as you want, issuing a warning when you try to
: assign a value to a non-defined variable (and even showing you the
mistyped
: variable name!).
:
: If you want to go one step further, you can create macros that allow you
to
: use named options with macro functions (so you don't have to
declare/assign
: all the options you want to use) - see my Spline Macro File at
: http://www.geocities.com/ccolefax/spline for details.
:
:
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
=Bob= wrote:
>
> I'd really like it if PovRay had assignment operators,
> so that it would know the difference between declaring
> a variable and assigning a value to an existing one. It
> would, in my case, signal a typo for the multitude of
> variables used in some of my code. I like to declare
> the default variables and then change them as needed
> prior to calling macros.
>
Chris Huff's Megapov Plus has a new #set directive that does exactly this
(it produces an error if used with a not declared identifier)
Christoph
--
Christoph Hormann <chr### [at] gmx de>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Hi Christoph,
I just tried it and it works just like you said, that's
great! Do you know if this feature will be incorporated
into the next official release of PovRay?
Thanks again, have a great day!
=Bob=
"Christoph Hormann" <chr### [at] gmx de> wrote in message
news:3A2A0385.3E05A9FD@gmx.de...
[My previous post deleted]
: Chris Huff's Megapov Plus has a new #set directive that does exactly this
: (it produces an error if used with a not declared identifier)
:
: Christoph
:
: --
: Christoph Hormann <chr### [at] gmx de>
: IsoWood include, radiosity tutorial, TransSkin and other
: things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
=Bob= wrote:
>
> Hi Christoph,
>
> I just tried it and it works just like you said, that's
> great! Do you know if this feature will be incorporated
> into the next official release of PovRay?
>
> Thanks again, have a great day!
> =Bob=
>
I don't think so, it was developed quite lately (just like the displace
warp :-) and therefore won't make it to the official version AFAIK.
BTW the current list with new features in 3.5 is in povray.announce.f-a-q.
Subject: POV-Team Status Report - September 1, 2000
Christoph
--
Christoph Hormann <chr### [at] gmx de>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3a29b642@news.povray.org>, "Chris Colefax"
<chr### [at] tag povray org> wrote:
> Why patch POV when you can do it with macros?:
Because you can't do this with macros? :-)
The #set directive works with both #declare and #local, and will be
faster than calling a macro, not to mention looking better in the scene
code...
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3a2a618d@news.povray.org>, "=Bob=" <Bob### [at] threestrands com>
wrote:
> Do you know if this feature will be incorporated
> into the next official release of PovRay?
It won't be, it is too new. As Christoph Hormann mentioned, the feature
list for 3.5 is in povray.announce.frequently-asked-questions.
It might make it into the next MegaPOV, whenever that comes out.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thanks, Chris.
I checked out the list too. That's a feature that would
be rather nice to have. My only concern is making
something that can be used in all of the popular
versions. I guess that's not too easy.
Have a great day!
=Bob=
"Chris Huff" <chr### [at] mac com> wrote in message
news:chrishuff-DF6AD7.05471904122000@news.povray.org...
: In article <3a2a618d@news.povray.org>, "=Bob=" <Bob### [at] threestrands com>
: wrote:
:
: > Do you know if this feature will be incorporated
: > into the next official release of PovRay?
:
: It won't be, it is too new. As Christoph Hormann mentioned, the feature
: list for 3.5 is in povray.announce.frequently-asked-questions.
: It might make it into the next MegaPOV, whenever that comes out.
:
: --
: Christopher James Huff
: Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
: TAG: chr### [at] tag povray org, http://tag.povray.org/
:
: <><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Chris Huff wrote:
>
> In article <3a29b642@news.povray.org>, "Chris Colefax"
> <chr### [at] tag povray org> wrote:
>
> > Why patch POV when you can do it with macros?:
>
> Because you can't do this with macros? :-)
Careful ! Everytime I think something is impossible to do with
POV-Ray Mr. Colefax or Mr. Parker comes along and show just how
possible it really is :)
--
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |