POV-Ray : Newsgroups : povray.general : ImageWidth not declared? Server Time
22 Dec 2024 13:52:56 EST (-0500)
  ImageWidth not declared? (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: Robert Kennedy
Subject: ImageWidth not declared?
Date: 15 Jan 2018 11:15:01
Message: <web.5a5cd31e3ef6c1e2e82f82270@news.povray.org>
So it's been a few years since I last used Povray, and I started on a scene
today...only for my first command to throw an error.  Here's the source:

camera {
 location <3, 1, 3>
 look_at 0
 right x*ImageWidth/ImageHeight
 up y
 }

Here's the error:

Persistence of Vision(tm) Ray Tracer Version 3.7.0.unofficial (g++ 5.2.1 @
 i686-pc-linux-gnu)

File 'what.pov' line 4: Parse Error: Expected 'numeric expression', undeclared
 identifier 'ImageWidth' found instead
Fatal error in parser: Cannot parse input.
Render failed

I verified the format by comparing it to the official documentation.  Checking
further, I found that ImageHeight throws the same error.  As I said, it's been a
few years.  Has somebody decided that ImageWidth and ImageHeight no longer need
to exist?  Or have I forgotten something?


Post a reply to this message

From: William F Pokorny
Subject: Re: ImageWidth not declared?
Date: 15 Jan 2018 11:27:45
Message: <5a5cd681$1@news.povray.org>
On 01/15/2018 11:13 AM, Robert Kennedy wrote:
> So it's been a few years since I last used Povray, and I started on a scene
> today...only for my first command to throw an error.  Here's the source:
> 
> camera {
>   location <3, 1, 3>
>   look_at 0
>   right x*ImageWidth/ImageHeight
>   up y
>   }
> 
> Here's the error:
> 
> Persistence of Vision(tm) Ray Tracer Version 3.7.0.unofficial (g++ 5.2.1 @
>   i686-pc-linux-gnu)
> 
> File 'what.pov' line 4: Parse Error: Expected 'numeric expression', undeclared
>   identifier 'ImageWidth' found instead
> Fatal error in parser: Cannot parse input.
> Render failed
> 
> I verified the format by comparing it to the official documentation.  Checking
> further, I found that ImageHeight throws the same error.  As I said, it's been a
> few years.  Has somebody decided that ImageWidth and ImageHeight no longer need
> to exist?  Or have I forgotten something?
> 
> 
Try:

right x*image_width/image_height

All built in POV-Ray keywords are lower case. I find myself using the 
online keywords index all the time. You can find it at:

http://wiki.povray.org/content/Reference:Keywords

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: ImageWidth not declared?
Date: 15 Jan 2018 11:30:03
Message: <web.5a5cd63cac415efc5cafe28e0@news.povray.org>
"Robert Kennedy" <nomail@nomail> wrote:
Has somebody decided that ImageWidth and ImageHeight no longer need
> to exist?  Or have I forgotten something?

You forgot that capitalization means something.
The correct reserved internal variable names are:

image_width
image_height

You CAN do something like
#declare ImageHeight = image_height;
#declare ImageWidth = image_width;

and then go from there.


Post a reply to this message

From: Robert Kennedy
Subject: Re: ImageWidth not declared?
Date: 15 Jan 2018 12:35:00
Message: <web.5a5ce615ac415efce82f82270@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Robert Kennedy" <nomail@nomail> wrote:
> Has somebody decided that ImageWidth and ImageHeight no longer need
> > to exist?  Or have I forgotten something?
>
> You forgot that capitalization means something.
> The correct reserved internal variable names are:
>
> image_width
> image_height
>
> You CAN do something like
> #declare ImageHeight = image_height;
> #declare ImageWidth = image_width;
>
> and then go from there.

Yeah, that was it.  As an excuse, I mention this web page:

http://www.povray.org/documentation/view/3.6.2/153/

which uses ImageWidth and ImageHeight.  Perhaps it needs to be updated?


Post a reply to this message

From: William F Pokorny
Subject: Re: ImageWidth not declared?
Date: 15 Jan 2018 12:56:32
Message: <5a5ceb50$1@news.povray.org>
On 01/15/2018 12:34 PM, Robert Kennedy wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> 
> Yeah, that was it.  As an excuse, I mention this web page:
> 
> http://www.povray.org/documentation/view/3.6.2/153/
> 
> which uses ImageWidth and ImageHeight.  Perhaps it needs to be updated?
> 
> 
Unsure the 3.6 docs will be touched at this point. The 3.7/3.8 
equivalent page:

http://wiki.povray.org/content/Knowledgebase:Language_Questions_and_Tips#Topic_19

has been updated with the correct keywords. It also strongly discourages 
use of the keywords to a degree with which I don't agree.

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: ImageWidth not declared?
Date: 15 Jan 2018 18:35:00
Message: <web.5a5d3a82ac415efc5cafe28e0@news.povray.org>
"Robert Kennedy" <nomail@nomail> wrote:

> Yeah, that was it.  As an excuse, I mention this web page:
>
> http://www.povray.org/documentation/view/3.6.2/153/
>
> which uses ImageWidth and ImageHeight.  Perhaps it needs to be updated?

I think it's been mentioned that the wiki is the best place to keep up with the
documentation.  I only use online help for posting links, for "real" help I use
the F1 Help, or the Insert Menu examples, or Friederich Lohmueller's site.

You might keep in mind that reserved internal variable names are highlighted in
that purple color - so if you reach the end of the variable name, and it doesn't
turn purple...   Sometimes I can't remember if there's an underscore for certain
ones....


Post a reply to this message

From: clipka
Subject: Re: ImageWidth not declared?
Date: 16 Jan 2018 02:57:54
Message: <5a5db082$1@news.povray.org>
Am 15.01.2018 um 18:34 schrieb Robert Kennedy:

> http://www.povray.org/documentation/view/3.6.2/153/
> 
> which uses ImageWidth and ImageHeight.  Perhaps it needs to be updated?

The code snippet in that section is a "general way to set the correct
aspect ratio piece of documentation", indicating that (or at least being
consistent with the interpretation that) "ImageWidth" and "ImageHeight"
are intended to be placeholders for the values you used for the INI
settings of the same names.


Post a reply to this message

From: clipka
Subject: Re: ImageWidth not declared?
Date: 16 Jan 2018 03:24:05
Message: <5a5db6a5$1@news.povray.org>
Am 15.01.2018 um 18:56 schrieb William F Pokorny:

> Unsure the 3.6 docs will be touched at this point. The 3.7/3.8
> equivalent page:
> 
> http://wiki.povray.org/content/Knowledgebase:Language_Questions_and_Tips#Topic_19
> 
> 
> has been updated with the correct keywords. It also strongly discourages
> use of the keywords to a degree with which I don't agree.

You're not the only one.

That's why POV-Ray 3.8.0-alpha will even use `right
x*image_width/image_height` as the default (provided you specify
`#version 3.8` at the very start of the file).


The reasons stated do have their merit, but I think they warrant no more
than to just advise some caution.

It should also be noted that scene authors worried about the issues can
use a construct like the following to enforce the intended aspect ratio:

    #if (image_width/image_height != 4/3)
      #error "Scene is designed for 4:3 aspect ratio!\n"
    #end

Users who may need to render to a non-square pixel format should indeed
opt for a fixed aspect ratio, and use a variation of the above test to
warn rather than abort:

    camera {
      right x*4/3
    }
    #if (image_width/image_height != 4/3)
      #warning "Scene is designed for 4:3 aspect ratio!\n"
      #warning "Rendering for non-square pixels.\n"
    #end


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: ImageWidth not declared?
Date: 17 Jan 2018 14:40:00
Message: <web.5a5fa64fac415efcfd3cadc90@news.povray.org>
"Robert Kennedy" <nomail@nomail> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > "Robert Kennedy" <nomail@nomail> wrote:
> > Has somebody decided that ImageWidth and ImageHeight no longer need
> > > to exist?  Or have I forgotten something?
> >
> > You forgot that capitalization means something.
> > The correct reserved internal variable names are:
> >
> > image_width
> > image_height
> >
> > You CAN do something like
> > #declare ImageHeight = image_height;
> > #declare ImageWidth = image_width;
> >
> > and then go from there.
>
> Yeah, that was it.  As an excuse, I mention this web page:
>
> http://www.povray.org/documentation/view/3.6.2/153/
>
> which uses ImageWidth and ImageHeight.  Perhaps it needs to be updated?

It is meant to explain that you should insert the image height and width - 3.6
had no image width and height keywords.


Post a reply to this message

From: Mike Horvath
Subject: Re: ImageWidth not declared?
Date: 18 Jan 2018 01:22:26
Message: <5a603d22@news.povray.org>
On 1/15/2018 6:34 PM, Bald Eagle wrote:
> I think it's been mentioned that the wiki is the best place to keep up with the
> documentation.  I only use online help for posting links, for "real" help I use
> the F1 Help, or the Insert Menu examples, or Friederich Lohmueller's site.

Unfortunately, Google prefers the POV 3.6 docs to the wiki.

Mike


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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