POV-Ray : Newsgroups : povray.newusers : the direction_length calculation Server Time 4 Jun 2023 14:06:17 EDT (-0400)
 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:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.56fa77e419d34c693fdf54d50%40news.povray.org",
"dateCreated": "2016-03-29T12:45:00+00:00",
"datePublished": "2016-03-29T12:45:00+00:00",
"author": {
"@type": "Person",
"name": "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?

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?

```
 From: clipka Subject: Re: the direction_length calculation Date: 29 Mar 2016 10:51:08 Message: <56fa965c\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#56fa965c%241%40news.povray.org",
"dateCreated": "2016-03-29T14:51:08+00:00",
"datePublished": "2016-03-29T14:51:08+00:00",
"author": {
"@type": "Person",
"name": "clipka"
}
}
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).
```
 From: Lsq Subject: Re: the direction_length calculation Date: 29 Mar 2016 20:15:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.56fb1a77c56b3e183fdf54d50%40news.povray.org",
"dateCreated": "2016-03-30T00:15:00+00:00",
"datePublished": "2016-03-30T00:15:00+00:00",
"author": {
"@type": "Person",
"name": "Lsq"
}
}
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.
```