POV-Ray : Newsgroups : povray.unofficial.patches : A question on image_width Server Time
1 Nov 2024 21:19:20 EDT (-0400)
  A question on image_width (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Mr  Art
Subject: A question on image_width
Date: 19 May 2000 00:30:44
Message: <3924C309.975A48DA@gci.net>
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

From: Mr  Art
Subject: Re: A question on image_width
Date: 19 May 2000 00:56:16
Message: <3924C902.AEAF39A9@gci.net>
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

From: Mr  Art
Subject: Re: A question on image_width
Date: 19 May 2000 02:04:23
Message: <3924D8FA.213C663C@gci.net>
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

From: Chris Huff
Subject: Re: A question on image_width
Date: 19 May 2000 06:32:51
Message: <chrishuff_99-161F4E.05362519052000@news.povray.org>
In article <3924C309.975A48DA@gci.net>, "Mr. Art" <mr.### [at] gcinet> 
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] yahoocom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Nathan Kopp
Subject: Re: A question on image_width
Date: 19 May 2000 06:36:19
Message: <39251923$1@news.povray.org>
Mr. Art <mr.### [at] gcinet> 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

From: Chris Huff
Subject: Re: A question on image_width
Date: 19 May 2000 06:37:03
Message: <chrishuff_99-247F72.05403719052000@news.povray.org>
In article <3924C902.AEAF39A9@gci.net>, "Mr. Art" <mr.### [at] gcinet> 
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] yahoocom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Nathan Kopp
Subject: Re: A question on image_width
Date: 19 May 2000 06:38:04
Message: <3925198c@news.povray.org>
Mr. Art <mr.### [at] gcinet> 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

From: TonyB
Subject: Re: A question on image_width
Date: 19 May 2000 10:01:47
Message: <3925494b@news.povray.org>
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

From: Mr  Art
Subject: Re: A question on image_width
Date: 19 May 2000 13:31:14
Message: <392579FC.980BFCF@gci.net>
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] yahoocom
> TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
> Personal Web page: http://chrishuff.dhs.org/
> TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Mark Wagner
Subject: Re: A question on image_width
Date: 20 May 2000 00:43:27
Message: <392617ef@news.povray.org>
Mr. Art wrote in message <392### [at] gcinet>...
>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

Goto Latest 10 Messages Next 2 Messages >>>

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