POV-Ray : Newsgroups : povray.newusers : distance of the viewing plane to the camera Server Time
25 Nov 2024 11:51:02 EST (-0500)
  distance of the viewing plane to the camera (Message 1 to 3 of 3)  
From: hermans
Subject: distance of the viewing plane to the camera
Date: 24 Dec 2005 10:55:13
Message: <43ad6f61@news.povray.org>
For illustrating some properties of perspective I want to place the 
viewing plane at a given distance from the camera. I think this has to 
do with the direction vector, but also with the right vector.
If I put a perspective camera at a point <a,b,c> viewing in the 
direction <0,0,1> how can I determine the combination of the right and 
the direction vector to obtain the viewing plane, parallel to the 
(X,Z)-plane at a distance d from the camera in the direction determined 
by <0,0,1>?


Post a reply to this message

From: Roman Reiner
Subject: Re: distance of the viewing plane to the camera
Date: 24 Dec 2005 16:15:00
Message: <web.43adb90e26cbcc409c3c716e0@news.povray.org>
Hi hermans

Although i'm not sure i would guess that the distance of the viewing plane
is given by the length of the direction vector (compare to the illustration
at the docs 3.3.1.1). so to get what you want you should have to declare
direction as d*vnormalize(dicection_vector) where d is the distance of the
viewing plane to the cameras location.
AFAIK the right vector playes only a role with ortographic cameras where it
determines (with the up vector) the size of the image. it also has
consequences on the aspect ration of the image. it should have no effect on
the distance of the viewsing plane

Hope that helped
Regards Roman

hermans <sas### [at] telenetbe> wrote:
> For illustrating some properties of perspective I want to place the
> viewing plane at a given distance from the camera. I think this has to
> do with the direction vector, but also with the right vector.
> If I put a perspective camera at a point <a,b,c> viewing in the
> direction <0,0,1> how can I determine the combination of the right and
> the direction vector to obtain the viewing plane, parallel to the
> (X,Z)-plane at a distance d from the camera in the direction determined
> by <0,0,1>?


Post a reply to this message

From: Chris B
Subject: Re: distance of the viewing plane to the camera
Date: 24 Dec 2005 16:30:04
Message: <43adbddc$1@news.povray.org>
"hermans" <sas### [at] telenetbe> wrote in message 
news:43ad6f61@news.povray.org...
> For illustrating some properties of perspective I want to place the 
> viewing plane at a given distance from the camera. I think this has to do 
> with the direction vector, but also with the right vector.
> If I put a perspective camera at a point <a,b,c> viewing in the direction 
> <0,0,1> how can I determine the combination of the right and the direction 
> vector to obtain the viewing plane, parallel to the (X,Z)-plane at a 
> distance d from the camera in the direction determined by <0,0,1>?

Hi,

With the camera at <A,B,C> and a 'direction' vector of <0,0,1>  then, if you 
imagine a viewing plane 1 unit from the camera in the +z direction, the 
image will fill a rectangle on the viewing plane that has a width as defined 
by the 'x' component of the 'right' vector and a height as defined by the 
'y' component of the 'up' vector (so long as the other components of the 
'right' and 'up' vectors are 0).

The 'right' vector and the 'up' vector normally match the proportions of the 
image, so for an 800 x 600 image you would use x*4/3 for the 'right' vector 
and y for the 'up' vector (the default values). If these are not in 
proportion the image gets distorted (as in the following example).

The following SDL illustrates that, so long as the RightVector is a multiple 
of <1,0,0> and the UpVector is a multiple of <0,1,0>, then it should keep 
the spheres in the corners of the image (despite potentially distorting the 
image).

Regards, and Merry Xmas
Chris B.



#local A = 5;
#local B = 2;
#local C = 3;
#local RightVector = x*4/3;
#local UpVector = 2*y;

light_source { < -15, 10  ,-80> color rgb 1}
camera {location <A,B,C> direction <0,0,1>
  right RightVector
  up UpVector
}

sphere {<A-RightVector.x/2,B-UpVector.y/2,C+1>,0.05 pigment {color rgb 
<50,0,0>}}
sphere {<A-RightVector.x/2,B+UpVector.y/2,C+1>,0.05 pigment {color rgb 
<50,0,0>}}
sphere {<A+RightVector.x/2,B-UpVector.y/2,C+1>,0.05 pigment {color rgb 
<50,0,0>}}
sphere {<A+RightVector.x/2,B+UpVector.y/2,C+1>,0.05 pigment {color rgb 
<50,0,0>}}

box {-0.5,0.5 rotate <45,45,0> translate <A,B,C+2> pigment {color rgb 
<1,0,1>}}


Post a reply to this message

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