POV-Ray : Newsgroups : povray.newusers : straight columns render bent Server Time
25 Nov 2024 09:48:40 EST (-0500)
  straight columns render bent (Message 1 to 5 of 5)  
From: Edee
Subject: straight columns render bent
Date: 9 Feb 2006 23:20:01
Message: <web.43ec143898ea61658bbafa7b0@news.povray.org>
my images show straight objects such as a lamp post to be bent outwards from
the <0,0,0> origin
I have worked a number of options unsuccessfully.  Has anyone ran into this
issue?

Sample camera:
camera {
  location    <52, -2, 2.8>
  direction   y
  sky         z
  up          z
  right     image_width*x/image_height
  look_at     <0,0,-10>
//  angle       30
}


Post a reply to this message

From: Thomas de Groot
Subject: Re: straight columns render bent
Date: 10 Feb 2006 03:42:59
Message: <43ec5213$1@news.povray.org>
Do you mean that in your scene the objects appear to be bent outward? In
that case, it is because the camera is pointing slightly upwards and you
have a case of parallax view (like in a real world camera, by the way).
In your case, where z seems to be up, you can rapidly solve this by using
the same z-value for location and look_at. The drawback is that your horizon
is then in the exact middle of the image, but for a start that will do.
There is a little utility somewhere in one of the newsgroups that will
straighten vertical objects in such cases. I shall have a look...

Thomas


"Edee" <rah### [at] yahoocom> schreef in bericht
news:web.43ec143898ea61658bbafa7b0@news.povray.org...
> my images show straight objects such as a lamp post to be bent outwards
from
> the <0,0,0> origin
> I have worked a number of options unsuccessfully.  Has anyone ran into
this
> issue?
>
> Sample camera:
> camera {
>   location    <52, -2, 2.8>
>   direction   y
>   sky         z
>   up          z
>   right     image_width*x/image_height
>   look_at     <0,0,-10>
> //  angle       30
> }
>
>
>


Post a reply to this message

From: Thomas de Groot
Subject: Re: straight columns render bent
Date: 10 Feb 2006 03:46:26
Message: <43ec52e2@news.povray.org>
Yes I found it.
Try this include file from Dr John, posted somewhere in 2005.

Thomas


Post a reply to this message


Attachments:
Download 'DJ_FieldCam.inc.txt' (3 KB)

From: Thomas de Groot
Subject: Re: straight columns render bent
Date: 10 Feb 2006 09:41:51
Message: <43eca62f@news.povray.org>
"Thomas de Groot" <t.d### [at] internlnet> schreef in bericht
news:43ec5213$1@news.povray.org...
> Do you mean that in your scene the objects appear to be bent outward? In
> that case, it is because the camera is pointing slightly upwards and you
> have a case of parallax view (like in a real world camera, by the way).
> In your case, where z seems to be up, you can rapidly solve this by using
> the same z-value for location and look_at. The drawback is that your
horizon
> is then in the exact middle of the image, but for a start that will do.
> There is a little utility somewhere in one of the newsgroups that will
> straighten vertical objects in such cases. I shall have a look...
>

I fact, I explain it all wrong: your camera is pointing downward, so the
objects are bending outward. Still a parallax question.... :-)

Thomas


Post a reply to this message

From: Edee
Subject: Re: straight columns render bent
Date: 10 Feb 2006 18:00:00
Message: <web.43ed19aa6be674138bbafa7b0@news.povray.org>
"Thomas de Groot" <t.d### [at] internlnet> wrote:
> "Thomas de Groot" <t.d### [at] internlnet> schreef in bericht
> news:43ec5213$1@news.povray.org...
> > Do you mean that in your scene the objects appear to be bent outward? In
> > that case, it is because the camera is pointing slightly upwards and you
> > have a case of parallax view (like in a real world camera, by the way).
> > In your case, where z seems to be up, you can rapidly solve this by using
> > the same z-value for location and look_at. The drawback is that your
> horizon
> > is then in the exact middle of the image, but for a start that will do.
> > There is a little utility somewhere in one of the newsgroups that will
> > straighten vertical objects in such cases. I shall have a look...
> >
>
> I fact, I explain it all wrong: your camera is pointing downward, so the
> objects are bending outward. Still a parallax question.... :-)
>
> Thomas

That seemed to help after I switched from a Y vertical to a Z vertical
vector in the macro. (modifief version listed below)
It works great for standard size rendered images, but for wide angle
shots, such as 1024X384, the plane appears to be spherical.
The closest I could come to a straigt line has been to just use perspective
in my camera options:
//planter view closeup looking at waterfall and pond
camera {
  perspective
  location    <14, -20, 6.8>
 // direction   y
  sky         z
 // up          z
  right     image_width*x/image_height
  look_at     <0,0,0>
//  angle       30
}

I will use that for now unless I can come up with a fix for the spherical
transformation and thank you for the suggestion, it helped work beyond the
issue.


//Modified version of ohn Guthkelch
//  to have Z vertical instead of Y vertical
#macro FieldCam (CP, CL)
 #local CD=CL-CP;
 #if (CD.x!=0 | CD.z!=0) // Note: That's a Boolean OR not an uppercase i
    // or a lowercase L!
  #local HypoXY=sqrt(pow(CD.x, 2)+pow(CD.y, 2));
  #local VCorr=pow(vlength(CD), 2)/pow(HypoXY, 2);
  #local CosThetaX=CD.x/HypoXY;
  #local CosThetaY=CD.y/HypoXY;
  #if (CD.x=0)
   #local ShearX=0;
  #else
   #local ShearX=(CD.z/CD.x)*pow(CosThetaX, 2);
  #end
  #if (CD.y=0)
   #local ShearY=0;
  #else
   #local ShearY=(CD.z/CD.y)*pow(CosThetaY, 2);
  #end
  #declare NoFall=transform {
   matrix <1, 0, 0, ShearX, VCorr, ShearY, 0, 0, 1, 0, 0, 0>
  }
 #else
  #warning "Viewing vector is perpendicular to XZ-plane.n"
  #warning "Camera changed to default type.n"
  #declare NoFall=transform {
   matrix <1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0>
  }
 #end
#end


Post a reply to this message

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