POV-Ray : Newsgroups : povray.binaries.images : POV-Ray corporate headquarters : Re: POV-Ray corporate headquarters Server Time
31 Jul 2024 10:27:56 EDT (-0400)
  Re: POV-Ray corporate headquarters  
From: Thomas de Groot
Date: 26 Apr 2010 03:58:49
Message: <4bd547b9@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> schreef in bericht 
news:web.4bd49aa88f076cd8ae92d9930@news.povray.org...
> There's an aspect to the entire scene that may be giving it an overall odd 
> look:
> The camera has a very wide-angle view (which normally distorts 
> everything.) I
> tried to correct for this in the individual objects--rotating them to be
> more-or-less vertical 'visually.'  But I didn't do it to *all* the objects 
> (the
> trees are still slanted, for example.) It was an experiment that didn't 
> quite
> work out as planned.
>

There is a piece of *ancient* code that might help you with this, written by 
Doctor John. I copy it here 'as is':

// Persistence of Vision SDL include file
// Description: A macro to simulate lens movements in architectural scenes
//  Helps prevent the "falling verticals syndrome"
// Author: John Guthkelch (Doctor John) <doc### [at] linuxmailorg>
// Version 2.0 Released September 2005
// Changes: 1. Improved warning so that camera automatically reverts to 
default
//     type if insane values are given for CamPos and/or CamLook
//     2. Corrected silly mathematical error in vertical scaling.This
//     is now correct so switch has been taken out.

/***********************************************************************
Don't forget to switch off Vista Buffers by using -uv on the command line
or Vista_Buffer=0 in your .ini file before attempting to render your image
***********************************************************************/

#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 HypoXZ=sqrt(pow(CD.x, 2)+pow(CD.z, 2));
  #local VCorr=pow(vlength(CD), 2)/pow(HypoXZ, 2);
  #local CosThetaX=CD.x/HypoXZ;
  #local CosThetaZ=CD.z/HypoXZ;
  #if (CD.x=0)
   #local ShearX=0;
  #else
   #local ShearX=(CD.y/CD.x)*pow(CosThetaX, 2);
  #end
  #if (CD.z=0)
   #local ShearZ=0;
  #else
   #local ShearZ=(CD.y/CD.z)*pow(CosThetaZ, 2);
  #end
  #declare NoFall=transform {
   matrix <1, 0, 0, ShearX, VCorr, ShearZ, 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

/*********************************USAGE**************************************

#declare CamPos=<Xc, Yc, Zc>;   //Just replace <Xc,Yc,Zc> with location 
vector
#declare CamLook=<Xl, Yl, Zl>;  // -"-   -"-   <Xl,Yl,Zl> with look_at 
vector

camera {
 FieldCam (CamPos, CamLook)
 perspective
 location CamPos
 [angle Whatever] // Not essential but can be used
 [right If_you_want] // Also not essential but can be used
 transform {NoFall}
 look_at CamLook
}
****************************************************************************/


Thomas


Post a reply to this message

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