<p>If you keep constant the scale at which you view the x-y plane (image plane), while changing the distance of the viewpoint to that plane, then you are not solely changing the viewpoint position; you are also changing the <em>field of view</em> (FOV). Here is an “overhead” view of the effect you're getting. Notice that the solid horizontal line (representing your x-y plane) is the same length in both cases.</p>
<p><a href="https://i.sstatic.net/xaIZc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xaIZc.png" alt="Diagram of two different distances and FOVs" /></a></p>
<p>When the viewpoint is far from the plane (<em>k</em> is large), the object is closer to the edge of the visible image. (In the limit <span class="math-container">$k = \infty$</span>, this becomes an orthographic projection.) When <em>k</em> is smaller, the FOV widens, meaning that objects in the same “world” position get projected to regions of the image closer to the center — notice where the lines of intersection between the box and the image plane are.</p>
<p>In order to avoid changing the field of view, what you must do is keep <em>k</em> constant (relative to the size of the image plane), but instead translate <em>both</em> the viewpoint and the image plane — or, equivalently, translate all the displayed objects in the opposite direction.</p>
<hr />
<p>Here is how FOV expressed as angle relates to <em>k:</em></p>
<p><a href="https://i.sstatic.net/FtRuI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FtRuI.png" alt="enter image description here" /></a></p>
<p><span class="math-container">$\theta$</span> is the FOV angle. Notice that the lines <span class="math-container">$k$</span> and <span class="math-container">$w$</span> (width) form a pair of right triangle. Split the picture down the middle and basic right-triangle trigonometry tells us that</p>
<p><span class="math-container">$$
\begin{align}
k &amp;= r \cos(\theta/2) \\
w/2 &amp;= r \sin(\theta/2) \\
\end{align}
$$</span></p>
<p>for some radius <span class="math-container">$r$</span> which is irrelevant (there is no physical circle). Solving these to relate <span class="math-container">$k$</span> and <span class="math-container">$w$</span> gives us:</p>
<p><span class="math-container">$$
w/2 = \tan(\theta/2) \cdot k
$$</span></p>
<p>This is how FOV is actually computed in the practice of real-time GPU graphics: a <span class="math-container">$k$</span> is chosen (called the “near plane” for unrelated reasons, chosen to be closer to the camera than any object in view), then the width and height of the rectangle (actually one face of a <a href="https://en.wikipedia.org/wiki/Viewing_frustum" rel="nofollow noreferrer">frustum</a>) are chosen based on the desired FOV and <span class="math-container">$k$</span>.</p>

CC BY-SA 4.0
2023-02-28T14:14:40.547Z
Thanks for your answer. I stated in the question a couple of steps one should perform to project a point in 3d to 2d. Is there in it a missing step? I agree with you that no cone of view has been defined in it. Suppose I want to work with a 60° cone of view. Then how should I correctly project the vertices using geometrical constructions as I have already done to produce this figure?
tush
CC BY-SA 4.0
2023-02-28T16:45:42.747Z
@tush "Is there in it a missing step?" Yes, the step of translating the objects relative to the image plane in order to move the camera. The procedure you implemented produces _a particular_ perspective projection. But in order to move the viewpoint in space without _also changing the projection_, you need to move the image plane and the viewpoint simultaneously (or equivalently move the viewed objects oppositely), not only the viewpoint.
Kevin Reid
CC BY-SA 4.0
2023-02-28T16:46:06.150Z
I've added a section to my answer about precisely how FOV relates to the parameters you're working with.
Kevin Reid
CC BY-SA 4.0
2023-02-28T17:08:01.447Z
Thanks for that. Though I still don't understand how differently I need to project a point to the canvas. I first don't want to vary the value of k. It seems to that I am missing a crucial step; It is not just "intersect a ray from the 3d point with the xy plane" - there is another step that I am not aware of.
tush
CC BY-SA 4.0
2023-02-28T18:45:36.163Z
@tush Translation is a _separate step_ from projection. You don't modify the projection; you translate the objects _before_ projecting them. (A geometry construction tool may not be the best way to experiment with this.) Or you can also see it as as moving the plane onto which the points are projected (exactly the same amount as you move the viewpoint) — this is the same thing with a different choice of coordinate system.
Kevin Reid
CC BY-SA 4.0
2023-02-28T05:12:06.633Z
2023-02-28T16:47:26.383Z
2023-02-28T16:47:26.383Z
Kevin Reid
<p>As nicely stated by Kevin Reid, the field of view is not accounted for in the figures I uploaded.</p>
<p>In order to get the correct coordinates for the projected points on the <span class="math-container">$x-y$</span> plane, one should also divide each component by the half width of the screen:</p>
<p>If <span class="math-container">$\mathbf{P}=\left(P_{x},P_{y},P_{z}\right)$</span> is the point in 3d and <span class="math-container">$\mathbf{P^{*}}\in\mathbb{R}^{2}$</span> is its projection, then
<span class="math-container">$$
P^{*}=\left(\frac{x_{P}}{\left(\frac{z_{P}}{k}+1\right)\frac{w}{2}},\frac{y_{P}}{\left(\frac{z_{P}}{k}+1\right)\frac{w}{2}}\right)=\left(\frac{x_{P}}{\tan\frac{\theta}{2}\left(k+z_{P}\right)},\frac{y_{p}}{\tan\frac{\theta}{2}\left(k+z_{P}\right)}\right)
$$</span></p>
<p>In the figure I provided, the coordinates for the <span class="math-container">$\mathbf{P^{*}}$</span> where almost similar, except of the scaling factor due to the finite width of the screen:
<span class="math-container">$$
P^{*}=\left(\frac{x_{P}}{\left(\frac{z_{P}}{k}+1\right)},\frac{y_{P}}{\left(\frac{z_{P}}{k}+1\right)}\right)
$$</span></p>
<p>Referring back to David Salomon's book, in §3.10, the cone of view (or viewing volume) is indeed mentioned but only in regard to “clipping” — to determine which points are outside the viewing volume and therefore to determine whether they should be displayed or not. Aside from that I couldn't find in his book the missing part I was looking for in this question.</p>

CC BY-SA 4.0
2023-03-02T19:12:50.677Z
2023-03-02T19:12:50.677Z
tush
<p>I am following David Salomon's book &quot;<a href="https://books.google.com/books?id=6CzuydFlMpwC" rel="nofollow noreferrer">Transformations and Projections in Computer Graphics</a>&quot; where it is explained how to project a 3d object to the 2d canvas in perspective:</p>
<p>Define a point for the viewer on the negative z-axis, a distance k away from the origin; Define the canvas as the x-y plane; Draw a line connecting a point on the object to the viewer and mark the intersection of this line with the x-y plane. This new point is the corresponding point when drawn in perspective.</p>
<p>I have done exactly that for a cube with the help of a geometry software (GeoGebra) and added an option to change the value of k, the location of the viewer.</p>
<p>Then I realized that the object actually looks larger on the canvas when k is increased. This is in contradiction to the expected illusion of perspective - objects further away should look smaller.</p>
<p>I would like to have your opinion about why it is so in my case.</p>
<p>** The drawing on the right hand side was created by following the exact procedure I explained above.</p>
<p><a href="https://i.sstatic.net/x340d.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/x340d.jpg" alt="enter image description here" /></a></p>

<perspective><line-drawing>
Why an object becomes larger when drawn in perspective
tush
# Why an object becomes larger when drawn in perspective

(Asked by: username_0 on 2023-02-27)

I am following David Salomon's book "[Transformations and Projections in Computer Graphics](https://books.google.com/books?id=6CzuydFlMpwC)" where it is explained how to project a 3d object to the 2d canvas in perspective:

Define a point for the viewer on the negative z-axis, a distance k away from the origin; Define the canvas as the x-y plane; Draw a line connecting a point on the object to the viewer and mark the intersection of this line with the x-y plane. This new point is the corresponding point when drawn in perspective.

I have done exactly that for a cube with the help of a geometry software (GeoGebra) and added an option to change the value of k, the location of the viewer.

Then I realized that the object actually looks larger on the canvas when k is increased. This is in contradiction to the expected illusion of perspective - objects further away should look smaller.

I would like to have your opinion about why it is so in my case.

\*\* The drawing on the right hand side was created by following the exact procedure I explained above.

[![enter image description here](https://i.sstatic.net/x340d.jpg)](https://i.sstatic.net/x340d.jpg)

**Tags:** perspective, line-drawing


---

## 2 answers

### Answer by username_1 on 2023-02-28. Score: 1 | Accepted answer

If you keep constant the scale at which you view the x-y plane (image plane), while changing the distance of the viewpoint to that plane, then you are not solely changing the viewpoint position; you are also changing the *field of view* (FOV). Here is an “overhead” view of the effect you're getting. Notice that the solid horizontal line (representing your x-y plane) is the same length in both cases.

[![Diagram of two different distances and FOVs](https://i.sstatic.net/xaIZc.png)](https://i.sstatic.net/xaIZc.png)

When the viewpoint is far from the plane (*k* is large), the object is closer to the edge of the visible image. (In the limit $k = \infty$, this becomes an orthographic projection.) When *k* is smaller, the FOV widens, meaning that objects in the same “world” position get projected to regions of the image closer to the center — notice where the lines of intersection between the box and the image plane are.

In order to avoid changing the field of view, what you must do is keep *k* constant (relative to the size of the image plane), but instead translate *both* the viewpoint and the image plane — or, equivalently, translate all the displayed objects in the opposite direction.

---

Here is how FOV expressed as angle relates to *k:*

[![enter image description here](https://i.sstatic.net/FtRuI.png)](https://i.sstatic.net/FtRuI.png)

$\theta$ is the FOV angle. Notice that the lines $k$ and $w$ (width) form a pair of right triangle. Split the picture down the middle and basic right-triangle trigonometry tells us that

$$
\begin{align}
k &= r \cos(\theta/2) \\
w/2 &= r \sin(\theta/2) \\
\end{align}
$$

for some radius $r$ which is irrelevant (there is no physical circle). Solving these to relate $k$ and $w$ gives us:

$$
w/2 = \tan(\theta/2) \cdot k
$$

This is how FOV is actually computed in the practice of real-time GPU graphics: a $k$ is chosen (called the “near plane” for unrelated reasons, chosen to be closer to the camera than any object in view), then the width and height of the rectangle (actually one face of a [frustum](https://en.wikipedia.org/wiki/Viewing_frustum)) are chosen based on the desired FOV and $k$.

> **Comments:**
> **username_0**: Thanks for your answer. I stated in the question a couple of steps one should perform to project a point in 3d to 2d. Is there in it a missing step? I agree with you that no cone of view has been defined in it. Suppose I want to work with a 60° cone of view. Then how should I correctly project the vertices using geometrical constructions as I have already done to produce this figure?  
> **username_1**: @username_0 "Is there in it a missing step?" Yes, the step of translating the objects relative to the image plane in order to move the camera. The procedure you implemented produces _a particular_ perspective projection. But in order to move the viewpoint in space without _also changing the projection_, you need to move the image plane and the viewpoint simultaneously (or equivalently move the viewed objects oppositely), not only the viewpoint.  
> **username_1**: I've added a section to my answer about precisely how FOV relates to the parameters you're working with.  
> **username_0**: Thanks for that. Though I still don't understand how differently I need to project a point to the canvas. I first don't want to vary the value of k. It seems to that I am missing a crucial step; It is not just "intersect a ray from the 3d point with the xy plane" - there is another step that I am not aware of.  
> **username_1**: @username_0 Translation is a _separate step_ from projection. You don't modify the projection; you translate the objects _before_ projecting them. (A geometry construction tool may not be the best way to experiment with this.) Or you can also see it as as moving the plane onto which the points are projected (exactly the same amount as you move the viewpoint) — this is the same thing with a different choice of coordinate system.  

---

### Answer by username_0 on 2023-03-02. Score: 0

As nicely stated by username_1, the field of view is not accounted for in the figures I uploaded.

In order to get the correct coordinates for the projected points on the $x-y$ plane, one should also divide each component by the half width of the screen:

If $\mathbf{P}=\left(P\_{x},P\_{y},P\_{z}\right)$ is the point in 3d and $\mathbf{P^{\*}}\in\mathbb{R}^{2}$ is its projection, then
$$
P^{\*}=\left(\frac{x\_{P}}{\left(\frac{z\_{P}}{k}+1\right)\frac{w}{2}},\frac{y\_{P}}{\left(\frac{z\_{P}}{k}+1\right)\frac{w}{2}}\right)=\left(\frac{x\_{P}}{\tan\frac{\theta}{2}\left(k+z\_{P}\right)},\frac{y\_{p}}{\tan\frac{\theta}{2}\left(k+z\_{P}\right)}\right)
$$

In the figure I provided, the coordinates for the $\mathbf{P^{\*}}$ where almost similar, except of the scaling factor due to the finite width of the screen:
$$
P^{\*}=\left(\frac{x\_{P}}{\left(\frac{z\_{P}}{k}+1\right)},\frac{y\_{P}}{\left(\frac{z\_{P}}{k}+1\right)}\right)
$$

Referring back to David Salomon's book, in §3.10, the cone of view (or viewing volume) is indeed mentioned but only in regard to “clipping” — to determine which points are outside the viewing volume and therefore to determine whether they should be displayed or not. Aside from that I couldn't find in his book the missing part I was looking for in this question.


---

