POV-Ray : Newsgroups : povray.text.scene-files : A true architectural field camera Server Time
31 Oct 2024 23:32:23 EDT (-0400)
  A true architectural field camera (Message 1 to 1 of 1)  
From: Doctor John
Subject: A true architectural field camera
Date: 27 Dec 2002 10:40:03
Message: <web.3e0c736a1f1273cdb29393de0@news.povray.org>
Desperately needed this for my IRTC entry this month and also for some
architectural work that I've been commissioned to do.

Worked out the maths on Xmas day (forbidden to touch the computer), coded
and ran multiple tests yesterday.

Happy New Year!

John
--

Run Fast
Run Free
Run Linux

//**********************************CODE STARTS**************************

// Persistence Of Vision raytracer file.
// Version 3.5
// field_camera.pov
// Created by John Guthkelch (Doctor John) - 26 December 2002
// This file demonstrates shearing the camera in an arbitrary plane
// to demonstrate a true architectural photographer's field camera effect.
// It assumes that up is +y

/************************************************************************
This file is a modification of Fabien Mosen's shear.pov which is in the
scenes/camera directory of your standard POVRay distro. Unfortunately, his
solution for "Falling Building Syndrome" only worked if the camera location/
look_at vector lay parallel to the YZ plane (or the XY plane if you moved
his
S_angle constant in the matrix). My algorithm should cure that limitation.
*************************************************************************/

/************************* IMPORTANT ***********************************
Use ' -uv ' on the commandline, because vista buffers cannot be used with
non-perpendicular camera vectors.
************************************************************************/
#version 3.5;

global_settings {
 assumed_gamma 1.0
}

#default {
 finish {
  ambient 0.3
 }
}

#include "colors.inc"
#include "camera-context.inc" //This is in your scenes/camera directory

#macro FieldCam (CP, CL)
 #local CD=CL-CP;
 #local HypoXZ=sqrt(pow(CD.x, 2)+pow(CD.z, 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, 1, ShearZ, 0, 0, 1, 0, 0, 0>
 }
#end

#declare CamPos=<-20, 3, -10>;
#declare CamLook=<0, 16, 4>;

camera {
 FieldCam (CamPos, CamLook)
 perspective
 location CamPos
 transform { NoFall }
 angle 135
 look_at CamLook
}

box {
 <-25, 0, -25>,<25, -1, 25>
 pigment {
  checker
  White, Gray80
  scale 5
 }
 finish {
  reflection {
   0.1
  }
 }
}

object {
 Cubes1
 translate <5, 0, -5>

}

object {
 Cubes2
 translate <9, 8, -6>
}

object {
 Cubes3
 translate < -15, 0, 5>
}

object {
 Cubes4
 translate <-10, 0, -5>
}

sphere {
 <-2, 3, 14>, 3
 pigment {
  SteelBlue
 }
 finish {
  phong 0.2
  reflection 0.3
 }
}

sky_sphere {
 pigment {
  rgb <0.859, 0.910, 0.831>
 }
}

light_source {
 <-100,120,-130>
 White*2
}
//******************************CODE ENDS**********************************


Post a reply to this message

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