POV-Ray : Newsgroups : povray.newusers : Setting image dimensions from the scene file? Server Time
29 Jul 2024 16:23:06 EDT (-0400)
  Setting image dimensions from the scene file? (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Aek Chomaitong
Subject: Setting image dimensions from the scene file?
Date: 22 May 2005 15:05:01
Message: <web.4290d70d50f6e2043279d4a10@news.povray.org>
Hello, everybody.

I would like to know if there is a way to specify the image dimensions from
within the scene file (not using +W and +H).

The reason I am asking for this is because the dimension of my images are
not known in advanced.  It is calculated from various parameters like the
width of the object in 3d, the position of the camera, and so on.

Right now, I have to perform the calculation twice.  Once in an external
program to determine the image dimension and another time in POV-Ray.  If I
can specify the image dimension in the scene file, like through some
built-in function, I can get rid of the first calculation which will save
lots of time and management.

Empty spaces in the images are significant so cropping the image later using
some external program would not help.

I appreciate your advice.

Thank you.

Aek Chomaitong


Post a reply to this message

From: Warp
Subject: Re: Setting image dimensions from the scene file?
Date: 22 May 2005 15:29:39
Message: <4290dda3@news.povray.org>
Aek Chomaitong <ach### [at] earthlinknet> wrote:
> I would like to know if there is a way to specify the image dimensions from
> within the scene file (not using +W and +H).

  No.

-- 
                                                          - Warp


Post a reply to this message

From: Aek Chomaitong
Subject: Re: Setting image dimensions from the scene file?
Date: 22 May 2005 15:45:00
Message: <web.4290e0f45f80a86f3279d4a10@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Aek Chomaitong <ach### [at] earthlinknet> wrote:
> > I would like to know if there is a way to specify the image dimensions from
> > within the scene file (not using +W and +H).
>
>   No.
>
> --
>                                                           - Warp

Dear Warp,

Thank you for the quick reply.  I'll get the source code and see
if I can add such functionality myself.

Aek.


Post a reply to this message

From: Kyle
Subject: Re: Setting image dimensions from the scene file?
Date: 22 May 2005 16:37:00
Message: <r1r1919u6sdisp5uoaunp7snia837vlq4t@4ax.com>
Aek:

I'm not sure if this helps, but since your are already having to
calculate the witdth and height values in an external program, could
you maybe just use the image_width and image_height variables within
the scene file when it is rendered?

Just a thought...

Kyle


On Sun, 22 May 2005 15:01:33 EDT, "Aek Chomaitong"
<ach### [at] earthlinknet> wrote:

>Hello, everybody.
>
>I would like to know if there is a way to specify the image dimensions from
>within the scene file (not using +W and +H).
>
>The reason I am asking for this is because the dimension of my images are
>not known in advanced.  It is calculated from various parameters like the
>width of the object in 3d, the position of the camera, and so on.
>
>Right now, I have to perform the calculation twice.  Once in an external
>program to determine the image dimension and another time in POV-Ray.  If I
>can specify the image dimension in the scene file, like through some
>built-in function, I can get rid of the first calculation which will save
>lots of time and management.
>
>Empty spaces in the images are significant so cropping the image later using
>some external program would not help.
>
>I appreciate your advice.
>
>Thank you.
>
>Aek Chomaitong
>


Post a reply to this message

From: Aek Chomaitong
Subject: Re: Setting image dimensions from the scene file?
Date: 22 May 2005 17:05:01
Message: <web.4290f3405f80a86f3279d4a10@news.povray.org>
Kyle <> wrote:
> Aek:
>
> I'm not sure if this helps, but since your are already having to
> calculate the witdth and height values in an external program, could
> you maybe just use the image_width and image_height variables within
> the scene file when it is rendered?
>
> Just a thought...
>
> Kyle

Dear Kyle,

I'm afraid I confused you.  Almost all calculations are in the scene
file.  However, after I come out with the width and height in the
scene file, I can not use it to control the image dimension from there
(since POV-Ray requires the image dimension up front).

To work around that, I copied a small part that calculates the image
dimension into another program and have that program call POV-Ray with the
correct image dimension.  It works but the problem is having to make sure
the code in the external program and the one in the scene file is in sync
at all times.  I also have to pass parameters to both the external program
and POV-Ray too.  This process is quite error prone.

I really appreciate your thought though.

Aek.


Post a reply to this message

From: JYR
Subject: Re: Setting image dimensions from the scene file?
Date: 22 May 2005 18:35:00
Message: <web.429108335f80a86f6a3607400@news.povray.org>
"Aek Chomaitong" <ach### [at] earthlinknet> wrote:
> I'm afraid I confused you.  Almost all calculations are in the scene
> file.  However, after I come out with the width and height in the
> scene file, I can not use it to control the image dimension from there
> (since POV-Ray requires the image dimension up front).
>
> To work around that, I copied a small part that calculates the image
> dimension into another program and have that program call POV-Ray with the
> correct image dimension.  It works but the problem is having to make sure
> the code in the external program and the one in the scene file is in sync
> at all times.  I also have to pass parameters to both the external program
> and POV-Ray too.  This process is quite error prone.
>
> I really appreciate your thought though.
>
> Aek.

Dear Aek,

Since you cannot set image dimension from within the scene description, but,
you have access to image_width and image_height, you can work around this
the other way.

*Have POV-Ray make the computations, including Requested_image_width and
Requested_image_height.
*Then have them compared against the built-in variables image_width and
image_height in a #if or a #switch statement
*If they match, POV-Ray keeps on rendering.
*If not, have POV-Ray create an INI file with proper width and height (see
documentation section 3.2.2.3 for opening and writing to a file) and abort
without rendering.

It still is cumbersome, as it is a 2 pass process. But at least the same
scene file is used to perform the computations in both case, which is much
less error prone.

Hoping this helps !

JYR


Post a reply to this message

From: Mike Williams
Subject: Re: Setting image dimensions from the scene file?
Date: 22 May 2005 20:15:45
Message: <$2FMCAA6+RkCFwGV@econym.demon.co.uk>
Wasn't it Aek Chomaitong who wrote:
>Hello, everybody.
>
>I would like to know if there is a way to specify the image dimensions from
>within the scene file (not using +W and +H).

Such a facility was available in some old versions of MegaPOV. It didn't
make it into the MegaPOV 1.0 rewrite. If your scene happens to be
compatible with POV 3.1, you could try running under MegaPOV 0.?.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Aek Chomaitong
Subject: Re: Setting image dimensions from the scene file?
Date: 23 May 2005 08:20:00
Message: <web.4291c9d15f80a86f3df8090e0@news.povray.org>
"JYR" <jyr### [at] hotmailcom> wrote:
> Dear Aek,
>
> Since you cannot set image dimension from within the scene description, but,
> you have access to image_width and image_height, you can work around this
> the other way.
>
> *Have POV-Ray make the computations, including Requested_image_width and
> Requested_image_height.
> *Then have them compared against the built-in variables image_width and
> image_height in a #if or a #switch statement
> *If they match, POV-Ray keeps on rendering.
> *If not, have POV-Ray create an INI file with proper width and height (see
> documentation section 3.2.2.3 for opening and writing to a file) and abort
> without rendering.
>
> It still is cumbersome, as it is a 2 pass process. But at least the same
> scene file is used to perform the computations in both case, which is much
> less error prone.
>
> Hoping this helps !
>
> JYR

Dear JYR,

Sorry for this late reply and thank you for your suggestion.  It looks quite
attractive since the code could be stored in one place.  I'll see if I can
create some queing system on top of the file system so this process can be
continued in a loop until no more INI files are left.

Aek.


Post a reply to this message

From: Aek Chomaitong
Subject: Re: Setting image dimensions from the scene file?
Date: 23 May 2005 08:25:00
Message: <web.4291ca975f80a86f3df8090e0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> Wasn't it Aek Chomaitong who wrote:
> >Hello, everybody.
> >
> >I would like to know if there is a way to specify the image dimensions from
> >within the scene file (not using +W and +H).
>
> Such a facility was available in some old versions of MegaPOV. It didn't
> make it into the MegaPOV 1.0 rewrite. If your scene happens to be
> compatible with POV 3.1, you could try running under MegaPOV 0.?.
>
> --
> Mike Williams
> Gentleman of Leisure

Dear Mike,

Thank you very much for this suggestion.  I'll check it out.

Aek.


Post a reply to this message

From: Dave Dunn
Subject: Re: Setting image dimensions from the scene file?
Date: 23 May 2005 08:45:00
Message: <web.4291cffa5f80a86fffb80bcc0@news.povray.org>
"Aek Chomaitong" <ach### [at] earthlinknet> wrote:
> Dear Mike,
>
> Thank you very much for this suggestion.  I'll check it out.
>
> Aek.

I believe the feature was called init_option, and it allowed you to run any
command line option from within the scene file. It might have been specific
to MegaPOV 0.7, so try there. It was an extremely useful feature and I
remember being a bit shocked that it didn't make its way into 3.5.


//Dave Dunn - hos### [at] aolcom
#local D = union { torus {1,.1 clipped_by {plane {-x,0}}} sphere
{<0,0,1>,.1} sphere {<0,0,-1>,.1} cylinder {<0,0,-1>,<0,0,1>,.1} pigment
{rgb .8} finish {ambient .5 reflection {.5}} rotate x*-90 translate
<-.5,.5,5>} object {D} object {D translate <.5,-1,0>} plane {y,-2 pigment
{checker rgb 1, rgb 0 scale 5} finish {ambient .5}}


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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