![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Are the keywords image_width and image_height functions
or variables? I had assumed that the values were set
during the parse processes and made to be variables.
So I tried this:
#ifndef (image_width)
#declare image_width=4;
#declare image_height=3;
#end
And got this
error: undeclared identifier expected but float function
'image_width' found instead.
All the docs had said was they were keywords.
I had wanted to set the values if I were using
Official POV. Is there any way to do this?
Maybe with a check of version....
Think I found my answer. Thanks for listening.
Mr. Art
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Well, I tried this:
#version unofficial MegaPov 0.5;
#warning concat("Version Value is:",str(version,0,3),"\n")
The value printed was 3.100 in MegaPOV
Then I tried
#warning concat("Version Value is:",str(version,0,3),"\n")
in Official POV and got 3.100.
It didn't help.
Is there any way for the scene file to
recognize that it is on the official as opposed to MegaPOV?
Mr. Art
"Mr. Art" wrote:
>
> Are the keywords image_width and image_height functions
> or variables? I had assumed that the values were set
> during the parse processes and made to be variables.
> So I tried this:
> #ifndef (image_width)
> #declare image_width=4;
> #declare image_height=3;
> #end
>
> And got this
> error: undeclared identifier expected but float function
> 'image_width' found instead.
>
> All the docs had said was they were keywords.
>
> I had wanted to set the values if I were using
> Official POV. Is there any way to do this?
> Maybe with a check of version....
>
> Think I found my answer. Thanks for listening.
>
> Mr. Art
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In the search to get the scene file to recognize
Official from Mega I found this:
#version official 3.1;
camera {location <0,.3,-1> right image_height/image_width*x look_at
<0,.2,0> angle 40 rotate -y*30}
sphere {0,0 pigment {rgb 0}}
still renders in MegaPOV!
'image_height' and 'image_width' are not official but are not
disabled with the #version statement. Even without the
#version statement they are active.
Is this a bug or a feature? :)
"Mr. Art" wrote:
>
> Are the keywords image_width and image_height functions
> or variables? I had assumed that the values were set
> during the parse processes and made to be variables.
> So I tried this:
> #ifndef (image_width)
> #declare image_width=4;
> #declare image_height=3;
> #end
>
> And got this
> error: undeclared identifier expected but float function
> 'image_width' found instead.
>
> All the docs had said was they were keywords.
>
> I had wanted to set the values if I were using
> Official POV. Is there any way to do this?
> Maybe with a check of version....
>
> Think I found my answer. Thanks for listening.
>
> Mr. Art
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3924C309.975A48DA@gci.net>, "Mr. Art" <mr.### [at] gci net>
wrote:
> Are the keywords image_width and image_height functions
> or variables? I had assumed that the values were set
> during the parse processes and made to be variables.
They are neither...they are constants, like "pi". In other words,
read-only.
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mr. Art <mr.### [at] gci net> wrote...
> Well, I tried this:
>
> #version unofficial MegaPov 0.5;
> #warning concat("Version Value is:",str(version,0,3),"\n")
>
> The value printed was 3.100 in MegaPOV
>
> Then I tried
> #warning concat("Version Value is:",str(version,0,3),"\n")
> in Official POV and got 3.100.
If you want to see the unofficial version number, use:
#warning concat("Unofficial Version Value
is:",str(unofficial_version,0,3),"\n")
-Nathan
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3924C902.AEAF39A9@gci.net>, "Mr. Art" <mr.### [at] gci net>
wrote:
> Is there any way for the scene file to
> recognize that it is on the official as opposed to MegaPOV?
From the manual, towards the top:
"Changing the unofficial version number has no affect on the official
language version number. You can also retreive the unofficial version
number using unofficial_version. The unofficial_version variable
returns -1 if unnofficial features are diabled."
You might be able to use #ifdef on unofficial_version, otherwise, you
will just have to include a flag in your include file that the person
rendering the file would have to change.
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mr. Art <mr.### [at] gci net> wrote...
> In the search to get the scene file to recognize
> Official from Mega I found this:
>
> 'image_height' and 'image_width' are not official but are not
> disabled with the #version statement. Even without the
> #version statement they are active.
>
> Is this a bug or a feature? :)
Depends on who you ask. ;-) Truthfully, it's a small bug.
-Nathan
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I noticed another one. I you put something unofficial in a macro, you don't
need to declare the unofficial version.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I tried your suggestion. #ifdef(unofficial_version) always returns
true. #ifndef(pi) returns true. It would seem that #ifndef only
checks variables, not constants.
If #ifndef() could return false for constants, than I could use
the #ifdef(unofficial_version) that you mentioned. But having
the end user change a flag in the file was what I was trying to
around.
If #ifndef() could return false for constants or if there could
be a value that #ifndef could test properly, we could make
scene files that could adjust to the allowed features and the
end user need not _have_ to know which files need special
attention, or have to choose which flavor POV to use.
A proposal:
1) Modify #ifndef() to return false for constants.
It seems logical that constants are defined.
2) Include a variable that #ifndef() could test even if it
wasn't modified that is only true in the patched flavors
of POV. Maybe like 'megapatch' being a pre defined variable
in MegaPOV. A test on it would let the scene file know what
to expect. I know that someone might want to use that as
a valid variable in their scene, but someone also might
want to use some of the other keywords that MegaPOV uses.
Its just one more that we would learn to capitalize if we
want to use it for our own.
Chris Huff wrote:
> You might be able to use #ifdef on unofficial_version, otherwise, you
> will just have to include a flag in your include file that the person
> rendering the file would have to change.
>
> --
> Christopher James Huff - Personal e-mail: chr### [at] yahoo com
> TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
> Personal Web page: http://chrishuff.dhs.org/
> TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mr. Art wrote in message <392### [at] gci net>...
>If #ifndef() could return false for constants or if there could
>be a value that #ifndef could test properly, we could make
>scene files that could adjust to the allowed features and the
>end user need not _have_ to know which files need special
>attention, or have to choose which flavor POV to use.
#ifdef(unofficial_version) should return false in the official version of
POV-Ray. In MegaPOV, it is always defined, but will be -1 if unofficial
features are disabled. This allows the following code to be used to decide
if unofficial features are available:
#ifdef(unofficial_version)
#if(unofficial_version = -1)
Official = true;
#else
Official = false;
#end
#else
Official = true;
#end
You can then use the value of Official elsewhere in your scene file to
determine if unofficial features can be used or not. This, however, says
nothing about which unofficial features can be used.
Mark
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |