 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Has povray lens shift camera for architecture? How to do?
Thank you all.
Tony
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
tony schrieb:
> Has povray lens shift camera for architecture? How to do?
It /might/ be possible by choosing the "up" and/or "right" camera
vectors to be nonperpendicular to the "direction" vector. Never tested
it though.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
clipka <ano### [at] anonymous org> wrote:
> tony schrieb:
> > Has povray lens shift camera for architecture? How to do?
>
> It /might/ be possible by choosing the "up" and/or "right" camera
> vectors to be nonperpendicular to the "direction" vector. Never tested
> it though.
Thanks, clipka.
I am exporting from blender with Blend2Pov. These are the data from the camera
in my scene:
camera { perspective angle 83.125 location <-0.347254,2.04441,-1.44341> right
0.74813*x sky <0,1,1.21856e-007> look_at <-0.347254,2.04441,-0.44341>}
I put in blender a lens shift y: -0.19
Should reflect the data in "up" parameter?
Tony
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
tony schrieb:
> I am exporting from blender with Blend2Pov. These are the data from the camera
> in my scene:
>
> camera { perspective angle 83.125 location <-0.347254,2.04441,-1.44341> right
> 0.74813*x sky <0,1,1.21856e-007> look_at <-0.347254,2.04441,-0.44341>}
>
> I put in blender a lens shift y: -0.19
I don't think lens shift is possible at all when using look_at to orient
the camera, as it will automatically reassign the up, right and
direction vectors.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 9 Sep 2009 13:34:15 EDT, "tony" <nomail@nomail> wrote:
>Has povray lens shift camera for architecture? How to do?
>
>Thank you all.
>
If you look in povray.binaries.scene-files, on 30 May 2008. Doctor John posted
something for someone who wanted a Tilt/Shift lens. The thread is called
"FieldCam for alex".
I hope that this helps.
--
Regards
Stephen
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Stephen <mcavoysAT@aolDOTcom> wrote:
> On Wed, 9 Sep 2009 13:34:15 EDT, "tony" <nomail@nomail> wrote:
>
> >Has povray lens shift camera for architecture? How to do?
> >
> >Thank you all.
> >
>
> If you look in povray.binaries.scene-files, on 30 May 2008. Doctor John posted
> something for someone who wanted a Tilt/Shift lens. The thread is called
> "FieldCam for alex".
>
> I hope that this helps.
> --
>
> Regards
> Stephen
Scuse me Stephen:
I downloaded the fieldcam.zip archive. Uncompressed the "fieldcam" archive,
without extension. I open it with a text processor and it is illegible. I do
not know to do whith this.
I am on windows.
Tony
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 9 Sep 2009 15:30:12 EDT, "tony" <nomail@nomail> wrote:
>Scuse me Stephen:
>
>I downloaded the fieldcam.zip archive. Uncompressed the "fieldcam" archive,
>without extension. I open it with a text processor and it is illegible. I do
>not know to do whith this.
>
>I am on windows.
Hi Tony,
I've not used the file myself I just remember Doctor John talking about
it one night when we were having a drink.
"FieldCam.zip" and can be opened with winzip. Inside the archive are three
folders one each for Mac, Unix and Windows. In the windows folder you will find
a file called "FieldCam3.inc". This is an include file that should be put in one
of your PovRay library paths.
In your scene you include the line:
#include FieldCam3.inc
This will allow PovRay to access the macro FieldCam()
You will need to read the include file for instructions on how to use it.
BTW just looking at the file, it looks to me that there is a line wrap problem
and some lines have had a cr/lf added. This means that you will need to go
through it and correct this problem before using it.
Doctor John does come by now and again so he might be able to help.
--
Regards
Stephen
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
You can apply any transform to the camera, including shearing.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 9 Sep 2009 17:18:13 -0400, Warp <war### [at] tag povray org> wrote:
> You can apply any transform to the camera, including shearing.
And how would a new user do that?
--
Regards
Stephen
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thanks Stephen:
When decompressing "FieldCam.zip" -> FieldCam, I put the zip extension and
returned to decompress. So are the three folders.
I put FieldCam3.inc in the "include" folder.
To obtain the parameters of lens shift, I exported to yafaray who has
implemented. These are the parameters yafaray:
<camera name="cam">
<aperture fval="0"/>
<bokeh_rotation fval="0"/>
<bokeh_type sval="disk1"/>
<dof_distance fval="0"/>
<focal fval="1.09375"/>
<from x="7.48113" y="-6.50764" z="5.34367"/>
<resx ival="800"/>
<resy ival="600"/>
<to x="6.82627" y="-5.89697" z="4.89842"/>
<type sval="perspective"/>
<up x="7.16376" y="-6.19517" z="6.23901"/>
</camera>
On Povray:
#declare CamPos=<7.48113,5.34367,-6.50764>;
#declare CamLook=<6.82627,4.89842,-5.89697>;
camera {
FieldCam ()
perspective
location CamPos
angle 49.1343
//right 1.33333*x blender parametter
//sky <-0.31737,0.895343,0.312469> blender parametter
up y <7.16376,6.23901,-6.19517>
transform {NoFall}
look_at CamLook
}
I'm trying to render and make error in "up y" (Parse Error: No matching) in
'camera, <found instead.
I'm approaching the process but I do not know what is bad.
Greetings.
Tony
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"tony" <nomail@nomail> wrote:
> camera {
> FieldCam ()
> perspective
> location CamPos
> angle 49.1343
> //right 1.33333*x blender parametter
> //sky <-0.31737,0.895343,0.312469> blender parametter
> up y <7.16376,6.23901,-6.19517>
> transform {NoFall}
> look_at CamLook
> }
>
>
> I'm trying to render and make error in "up y" (Parse Error: No matching) in
> 'camera, <found instead.
>
> I'm approaching the process but I do not know what is bad.
>
The line
> up y <7.16376,6.23901,-6.19517>
POV-ray expects a single vector after up, and you have two: the y vector, which
is <0,1,0>, and <7.16376,6.23901,-6.19517>. You should only have one, probably
the second one, since up y is the default for perpendicular camera vectors.
Try removing the y after up but leaving the second vector.
-Reactor
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
tony wrote:
> Has povray lens shift camera for architecture? How to do?
>
> Thank you all.
>
> Tony
>
>
As has been mentioned by Stephen, I did a macro a few years back. If
you're having problems with line wrapping, here's the full text:
/**************************************************/
// 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] linuxmail org>
// Version 3.0 Released May 2006
// History:
// Version 3.0: 1. Removed necessity of passing parameters when calling
// macro. Less typing needed :-)
// 2. Added code so macro can be used when using
// right-handed coordinates (i.e. z-axis is up).
// Version 2.0: 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.
/***********************************************************************
License & copyright:
(c) 2006 John Guthkelch
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version. This program is distributed in the hope that
it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
(See http://www.gnu.org/licenses/gpl.txt for the full GPL text)
***********************************************************************/
#macro FieldCam()
#local CD=CamLook-CamPos;
#ifndef (Up_Z)
#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
#else
#if (CD.x!=0 | CD.y!=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, 0, 1, 0, ShearX, ShearY, VCorr, 0, 0, 0>
}
#else
#warning "Viewing vector is perpendicular to XY-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
#end
/*****************USAGE1**********************
#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
[#declare Up_Z=1;] // Only use this #declare when using right-handed
coordinates
camera {
FieldCam ()
perspective
location CamPos
[angle Whatever] // Not essential but can be used
[right If_you_want] // Also not essential but can be used
up y | up z //whichever you need
transform {NoFall}
look_at CamLook
}
*************USAGE 2**********************
Don't forget to switch vista buffer off by putting Vista_Buffer=0 in
your .ini file or using -uv on the command line.
******************************************************************/
I have never tested the macro on any scenes in which the viewing axes
are anything but either 'up y' or 'up z' so ymmv with your rotated camera.
John
--
"Eppur si muove" - Galileo Galilei
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Additional: When I get home this evening, I'll test with your unusual up
vector. If I hit problems then I'll have an excuse to rewrite the macro
to deal with it (in my copious free time)
John
--
"Eppur si muove" - Galileo Galilei
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
tony wrote:
> Has povray lens shift camera for architecture? How to do?
>
> Thank you all.
>
> Tony
>
>
OK, Tony, i've now had a chance to play with your code.
Firstly, I don't quite understand why you're using such an unusual up
vector; you run into all sorts of problems with it. I suspect that this
is a product of the conversion process from Blender to Yafray but is
totally unnecessary in Povray. I suggest you read "3.3.1.1.5 Up and
Right Vectors" in the manual to understand why and how they're used.
Secondly, the FieldCam() macro was developed with an assumption that the
majority of people would be using either the standard left-hand system
or, at a pinch, the right-hand system, so you would use 'up y' or 'up z'
respectively. The macro looks at the camera position and the look-at
point and calculates the shearing values to ensure that the image plane
is always parallel to your chosen up vector. Unfortunately in its
present incarnation these vectors can only be <0,1,0> or <0,0,1> so the
camera is acting as if it had a limited shift function i.e it cannot
shift in y and x planes simultaneously. I am thinking about extending
its functionality but the macro would then need a total rewrite.
Lastly, try this in your scene:
#declare CamPos=<7.48113,5.34367,-6.50764>;
#declare CamLook=<6.82627,4.89842,-5.896970>;
camera {
FieldCam ()
perspective
location CamPos
angle 49.1343
right (image_width/image_height)*x
up y
transform {NoFall}
look_at CamLook
}
......and don't forget to switch off your vista buffers (-uv on the
command line)
John
--
"Eppur si muove" - Galileo Galilei
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Doctor John:
After reading the documentation and perform various tests I think we are talking
about different things:
1. Camera parameters
2. Lens parameters.
I put several renders with different values of lens shift so you can understand
what I get, if possible with povray:
http://i750.photobucket.com/albums/xx142/tony_p2009/lensshift.jpg
Is it possible on povray?
Thanks.
Tony
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
tony wrote:
> Doctor John:
>
> After reading the documentation and perform various tests I think we are talking
> about different things:
>
> 1. Camera parameters
> 2. Lens parameters.
>
> I put several renders with different values of lens shift so you can understand
> what I get, if possible with povray:
>
I don't think we are talking at cross-purposes, and I'll post a few
images to demonstrate what my macro does later ( I'll try to imitate
your test images as much as possible). It may be a couple of days though
as a death in the family has messed things up a bit and I need to
concentrate on that for the moment.
John
--
"Eppur si muove" - Galileo Galilei
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Doctor John wrote:
>
> I don't think we are talking at cross-purposes, and I'll post a few
> images to demonstrate what my macro does later ( I'll try to imitate
> your test images as much as possible). It may be a couple of days though
> as a death in the family has messed things up a bit and I need to
> concentrate on that for the moment.
>
> John
Sorry for the delay, I've now got what you wanted. See p.b.i for the
first test images. The code for the camera is:
=============================================================
#declare CamPos=<0, 0, -10.5>;
#declare CamLook=<0, 0, 0>;
#declare Distance=vlength(CamLook-CamPos);
#declare ShiftX=0.0; //use whatever numbers you need here n<1
#declare ShiftY=0.0; //use whatever numbers you need here n<1
camera {
perspective
location CamPos
look_at CamLook
right x*image_width/image_height
up <0, 1, 0>
transform {
matrix
<1,0,0,
0,1,0,
ShiftX,ShiftY,1,
ShiftX*Distance,ShiftY*Distance,0>
}
}
==============================================================
I'm going to merge this with my FieldCam work to produce a (close to)
fully functioning studio camera
John
--
"Eppur si muove" - Galileo Galilei
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |