POV-Ray : Newsgroups : povray.newusers : Setting image dimensions from the scene file? Server Time
29 Jul 2024 22:20:28 EDT (-0400)
  Setting image dimensions from the scene file? (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
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

From: Le Forgeron
Subject: Re: Setting image dimensions from the scene file?
Date: 23 May 2005 09:59:46
Message: <4291e1d2$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave Dunn wrote:
> "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.
> 

If pov-scene were to be distributed as zip package, it would not only
include a *.pov file, but also a *.ini file.
The habit of not providing a *.ini is a bad habit, trying to cure it
with an extension is a bad solution to a true problem.
The real interest of rendering is to be able to recompute an image.
If your *.pov override the size setting and the user have to parse the
whole thing to find it, it's a real bad thing.

The initial problem is not an issue of +H/+W, but of automatic camera
setting by the scene itself. So far, the problem is not yet solvable,
because, aside from the height and width in pixel, one is to assume the
pixel ratio of the final picture ( a 640x480 picture is not always 4:3,
it can be displayed as a square with the right pixel ratio).
At best, your camera-script-setting could use the (new ? 3.5+)
image_height and image_width to know the final dimension and make its
computation only once to insure that the object always fit the view.

(but you ends up with a fixed pixel-ratio, which might be
counterproductive when rendering for a computer and then for a DVD:
most computer screen resolution are using square pixel on PC (excepted
some fancy 1280x1024 on 4:3 CRT... ), whereas the DVD resolution is
720x576 (or 720x480 for the NTSC countries) *INDEPENDANTLY* of the
displaying media (it can be a 16:9 or a 4:3... NO square pixel on DVD!))

- --
Eifersucht ist die Leidenschaft, die mit Eifer sucht, was Leiden schafft.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCkeHRs/YJ43cSjHIRAtkqAKCIS91jo6A/3rEyNign8IEczbsbLwCcCvI/
ZGbdjtGPJ026bRkDjkW/2So=
=+Qet
-----END PGP SIGNATURE-----


Post a reply to this message

From: mikloyd
Subject: Re: Setting image dimensions from the scene file?
Date: 25 Aug 2005 13:15:00
Message: <web.430dfc765f80a86f25bf97700@news.povray.org>
Hey Aek!

What's up?

Did you figure this problem out?


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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