POV-Ray : Newsgroups : povray.newusers : straight columns render bent : Re: straight columns render bent Server Time
29 Jul 2024 10:29:13 EDT (-0400)
  Re: straight columns render bent  
From: Edee
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.