POV-Ray : Newsgroups : povray.newusers : Setting the aspect ratio Server Time
25 Nov 2024 01:23:29 EST (-0500)
  Setting the aspect ratio (Message 1 to 9 of 9)  
From: Ansgar
Subject: Setting the aspect ratio
Date: 8 Dec 2006 16:10:00
Message: <web.4579d374c1135f40e21d8a9b0@news.povray.org>
My problem is that my rendering outputs are distorted when I don't choose a
4:3 resolution like 800x600.
Now I know from the online help and from articles here that something like
this is supposed to work:
right x*(aspect ratio)

Unfortunately, it doesn't. In fact, that line doesn't have any effect at
all. May I be using another keyword that negates the effect or something?

May it have something to do with the fact that I'm working with a scene (and
a camera) which was converted over from a 3ds file with 3DWin5?

Here's my camera definition:

#declare P_cam = camera
{
  sky <0, 0, 1>                       // doesn't seem to have any effect
  up <0, 1, 0>                        // same
  right <1, 0, 0>                     // same. If I use 1 or 1.33 or 2 or
                                      // anything, always the same result
  location <22.695, -65.187, 31.461>
  look_at <-4.677, -4.445, 10.517>
  angle 45                            // I've read this can override "right"
                                      // settings, but I see no difference
                                      // if I leave it out
}

Thanks in advance.


Post a reply to this message

From: Alain
Subject: Re: Setting the aspect ratio
Date: 8 Dec 2006 16:31:04
Message: <4579d998$1@news.povray.org>
Ansgar nous apporta ses lumieres en ce 08/12/2006 16:07:
> My problem is that my rendering outputs are distorted when I don't choose a
> 4:3 resolution like 800x600.
> Now I know from the online help and from articles here that something like
> this is supposed to work:
> right x*(aspect ratio)

> Unfortunately, it doesn't. In fact, that line doesn't have any effect at
> all. May I be using another keyword that negates the effect or something?

> May it have something to do with the fact that I'm working with a scene (and
> a camera) which was converted over from a 3ds file with 3DWin5?

> Here's my camera definition:

> #declare P_cam = camera
> {
>   sky <0, 0, 1>                       // doesn't seem to have any effect
The default is <0,1,0>
>   up <0, 1, 0>                        // same
This and the previous are used to tilt the camera.
>   right <1, 0, 0>
Should be perpendicular to the "up" vector. Non-perpendicular leads to skewed image.
Those 3 should apears AFTER location, look_at and direction
                      // same. If I use 1 or 1.33 or 2 or
>                                       // anything, always the same result
>   location <22.695, -65.187, 31.461>
This should be the first camera item.
>   look_at <-4.677, -4.445, 10.517>
>   angle 45                            // I've read this can override "right"
>                                       // settings, but I see no difference
>                                       // if I leave it out
Not the "right" vector but the "direction" vector.
> }

> Thanks in advance.


Try this instead:
camera{location<22.695, -65.187, 31.461>
	direction z //not needed, default value
// this can be used instead of angle to change the field of view.
	look_at<-4.677, -4.445, 10.517>
	right x*1
	angle 45
	}


-- 
Alain
-------------------------------------------------
If you have one lawyer in town, he goes hungry.
If you have two lawyers in town, they both get rich.


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Setting the aspect ratio
Date: 8 Dec 2006 16:35:00
Message: <web.4579d96753a4c05ec150d4c10@news.povray.org>
"Ansgar" <Tem### [at] gmxde> wrote:
> My problem is that my rendering outputs are distorted when I don't choose a
> 4:3 resolution like 800x600.
> Now I know from the online help and from articles here that something like
> this is supposed to work:
> right x*(aspect ratio)
>
> Unfortunately, it doesn't. In fact, that line doesn't have any effect at
> all. May I be using another keyword that negates the effect or something?
>
> May it have something to do with the fact that I'm working with a scene (and
> a camera) which was converted over from a 3ds file with 3DWin5?
>
> Here's my camera definition:
>
> #declare P_cam = camera
> {
>   sky <0, 0, 1>                       // doesn't seem to have any effect
>   up <0, 1, 0>                        // same
>   right <1, 0, 0>                     // same. If I use 1 or 1.33 or 2 or
>                                       // anything, always the same result
>   location <22.695, -65.187, 31.461>
>   look_at <-4.677, -4.445, 10.517>
>   angle 45                            // I've read this can override "right"
>                                       // settings, but I see no difference
>                                       // if I leave it out
> }
>
> Thanks in advance.

  up y
  right x*image_width/image_height


-tgq


Post a reply to this message

From: Ansgar
Subject: Re: Setting the aspect ratio
Date: 8 Dec 2006 17:25:00
Message: <web.4579e54b53a4c05ee21d8a9b0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
>   up y
>   right x*image_width/image_height
>
> -tgq

I know that. The problem is it doesn't work.


Alain <ele### [at] netscapenet> wrote:
> Try this instead:
> camera{location<22.695, -65.187, 31.461>
>  direction z //not needed, default value
> // this can be used instead of angle to change the field of view.
>  look_at<-4.677, -4.445, 10.517>
>  right x*1
>  angle 45
>  }
>
> Alain

Hmmm, I get a funny tilted picture that way, but at least the aspect seems
right now... strange, I think it is because I declared the camera as
#declare P_cam = camera{...
and used it later via
camera{P_cam}
When I just write camera{... like you, it seems to have a different effect.
That shouldn't be, should it?


Post a reply to this message

From: Warp
Subject: Re: Setting the aspect ratio
Date: 9 Dec 2006 00:44:55
Message: <457a4d57@news.povray.org>
Trevor G Quayle <Tin### [at] hotmailcom> wrote:
>   right x*image_width/image_height

  That may be tempting, but not recommended:
http://tag.povray.org/povQandT/languageQandT.html#aspectratio

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: Setting the aspect ratio
Date: 9 Dec 2006 00:52:15
Message: <457a4f0f@news.povray.org>
Ansgar <Tem### [at] gmxde> wrote:
> right x*(aspect ratio)

> Unfortunately, it doesn't. In fact, that line doesn't have any effect at
> all. May I be using another keyword that negates the effect or something?

  An actual scene demonstrating the problem would have been helpful.

  I crated one and see no problem. The 'right' keyword is having the
proper effect. Try this with different values for 'right' (such as
<10, 0, 0>, the difference is quite clear):

#declare P_cam =
camera
{
  sky <0, 0, 1>                       // doesn't seem to have any effect
  up <0, 1, 0>                        // same
  right <1, 0, 0>                     // same. If I use 1 or 1.33 or 2 or
                                      // anything, always the same result
  location <22.695, -65.187, 31.461>
  look_at <-4.677, -4.445, 10.517>
  angle 45                            // I've read this can override "right"
                                      // settings, but I see no difference
                                      // if I leave it out
}

camera { P_cam }

plane
{ x, 0 pigment { checker rgb 1, rgb .5 scale 5 } finish { ambient 1 }
  rotate z*-45 rotate y*-45
}

  Which version of povray are you using?

-- 
                                                          - Warp


Post a reply to this message

From: Charles C
Subject: Re: Setting the aspect ratio
Date: 9 Dec 2006 04:25:01
Message: <web.457a7f8553a4c05e7d5894630@news.povray.org>
"Ansgar" <Tem### [at] gmxde> wrote:

> Hmmm, I get a funny tilted picture that way, but at least the aspect seems
> right now... strange, I think it is because I declared the camera as
> #declare P_cam = camera{...
> and used it later via
> camera{P_cam}
> When I just write camera{... like you, it seems to have a different effect.
> That shouldn't be, should it?

By tilted do you mean tilted completely over on it's side?  Considering your
sky & up vectors were 90 degrees off from each other in your original
camera, I wonder which way was up in your original file...  y or z?  Try
both sky y up y  and also sky z up z
Charles


Post a reply to this message

From: Ansgar
Subject: Re: Setting the aspect ratio
Date: 9 Dec 2006 20:30:00
Message: <web.457b627853a4c05e4752160e0@news.povray.org>
Gah, I'm such a doofus.

I tested your program, Warp, and then checked back with my own code to find
out what went wrong. Turns out that there is an #include between the camera
definition and its usage, and in that included file, the camera is
redefined. No wonder that my changes did not have any effect.
Sorry guys, that was incredibly stupid of me... but well, sometimes you
don't see the most obvious things.
Everything's just fine now.
My apologies for wasting your time, but thanks everyone for replying. :/


Post a reply to this message

From: Alain
Subject: Re: Setting the aspect ratio
Date: 10 Dec 2006 12:02:19
Message: <457c3d9b$1@news.povray.org>
Ansgar nous apporta ses lumieres en ce 2006-12-09 20:27:
> Gah, I'm such a doofus.

> I tested your program, Warp, and then checked back with my own code to find
> out what went wrong. Turns out that there is an #include between the camera
> definition and its usage, and in that included file, the camera is
> redefined. No wonder that my changes did not have any effect.
> Sorry guys, that was incredibly stupid of me... but well, sometimes you
> don't see the most obvious things.
> Everything's just fine now.
> My apologies for wasting your time, but thanks everyone for replying. :/



No problem my friend! :-)
EVERYBODY get hit with something similar sooner or later :-(


Post a reply to this message

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