POV-Ray : Newsgroups : povray.newusers : the direction_length calculation Server Time
27 Nov 2024 01:25:40 EST (-0500)
  the direction_length calculation (Message 1 to 3 of 3)  
From: Lsq
Subject: the direction_length calculation
Date: 29 Mar 2016 08:45:00
Message: <web.56fa77e419d34c693fdf54d50@news.povray.org>
Hi,about the following codes,I have some questions:

camera {
   location <10.0, 20.0, -100.0>
   angle 65
   right x*image_width/image_height
}

Question:The formula used is direction_length = 0.5 * right_length / tan(angle /
2) where right_length is the length of the right vector. How can I get the right
vector in this case or there is a default right vector?

camera {
   location <10.0, 20.0, -100.0>
   angle 65
   right x*image_width/image_height
   look_at <10.0, 20.0, 0.0>
}

Question:the help file says,"The look_at modifier changes both the up and right
vectors." And the direction_length calculation depends on the right vector.In
such a situation,how to compute the direction_length? And I think that the
direction vector is parallel to look_at vector,is it right?

Thank for your help!


Post a reply to this message

From: clipka
Subject: Re: the direction_length calculation
Date: 29 Mar 2016 10:51:08
Message: <56fa965c$1@news.povray.org>
Am 29.03.2016 um 14:42 schrieb Lsq:
> Hi,about the following codes,I have some questions:
> 
> camera {
>    location <10.0, 20.0, -100.0>
>    angle 65
>    right x*image_width/image_height
> }
> 
> Question:The formula used is direction_length = 0.5 * right_length / tan(angle /
> 2) where right_length is the length of the right vector. How can I get the right
> vector in this case or there is a default right vector?

In the above case, you have specified the "right" vector as
<image_width/image_height,0,0> yourself (because x is a constant equal
to <1,0,0>), so I fail to see what your question is.

The default "right" vector is x*1.33 (_not_ exactly 4/3).


> camera {
>    location <10.0, 20.0, -100.0>
>    angle 65
>    right x*image_width/image_height
>    look_at <10.0, 20.0, 0.0>
> }
> 
> Question:the help file says,"The look_at modifier changes both the up and right
> vectors." And the direction_length calculation depends on the right vector.In
> such a situation,how to compute the direction_length? And I think that the
> direction vector is parallel to look_at vector,is it right?

As look_at only rotates the up, right and direction vectors, but leaves
their length unchanged, direction_length is also unaffected.

As for the direction vector's orientation, it will be parallel to the
look_at vector _minus_ the camera location (becasue "look_at" does not
actually specify a direction but a point).


Post a reply to this message

From: Lsq
Subject: Re: the direction_length calculation
Date: 29 Mar 2016 20:15:00
Message: <web.56fb1a77c56b3e183fdf54d50@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 29.03.2016 um 14:42 schrieb Lsq:
> > Hi,about the following codes,I have some questions:
> >
> > camera {
> >    location <10.0, 20.0, -100.0>
> >    angle 65
> >    right x*image_width/image_height
> > }
> >
> > Question:The formula used is direction_length = 0.5 * right_length / tan(angle /
> > 2) where right_length is the length of the right vector. How can I get the right
> > vector in this case or there is a default right vector?
>
> In the above case, you have specified the "right" vector as
> <image_width/image_height,0,0> yourself (because x is a constant equal
> to <1,0,0>), so I fail to see what your question is.
>
> The default "right" vector is x*1.33 (_not_ exactly 4/3).
>
>
> > camera {
> >    location <10.0, 20.0, -100.0>
> >    angle 65
> >    right x*image_width/image_height
> >    look_at <10.0, 20.0, 0.0>
> > }
> >
> > Question:the help file says,"The look_at modifier changes both the up and right
> > vectors." And the direction_length calculation depends on the right vector.In
> > such a situation,how to compute the direction_length? And I think that the
> > direction vector is parallel to look_at vector,is it right?
>
> As look_at only rotates the up, right and direction vectors, but leaves
> their length unchanged, direction_length is also unaffected.
>
> As for the direction vector's orientation, it will be parallel to the
> look_at vector _minus_ the camera location (becasue "look_at" does not
> actually specify a direction but a point).

Thanks a lot! I got it.


Post a reply to this message

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