<p>In the video you linked to, $d$ is just the distance from the eye to the image plane.  To simplify things though, you can just set $d$ to 1, which is the usual case and causes it to disappear from the formulas.</p>

<p>Your formula for projection is a bit wrong but don't worry, projection is actually pretty simple.</p>

<p>$x_{Screen} = x_{World} / z_{World}\\
y_{Screen} = y_{World} / z_{World}$</p>

<p>If you want to move the center of projection, you can do so with a screen space coordinate, by modifying the formula to be this:</p>

<p>$x_{Screen} = x_{World} / z_{World} - x_{ScreenCenter}\\
y_{Screen} = y_{World} / z_{World} - y_{ScreenCenter}$</p>

<p>If you want to re-introduce the $d$ value to control the distance from the eye to the projection plane, you can use the formula below.  Adjusting $d$ will make the camera look like it is zooming in or out.  Again, you can just set $d$ to 1 though and not deal with it.</p>

<p>$x_{Screen} = d*x_{World} / z_{World} - x_{ScreenCenter}\\
y_{Screen} = d*y_{World} / z_{World} - y_{ScreenCenter}$</p>

CC BY-SA 3.0
2016-11-28T23:06:04.277Z
2016-11-28T23:06:04.277Z
Alan Wolfe
<p>If I have a point in world space: (wx, wy, wz)</p>

<p>and I have a centre of projection: (cx, cy, cz)</p>

<p>and I wanted to project that point using perspective projection</p>

<p>would my point on the screen be calculated by: </p>

<p>x = (cz * wx) / wz
y = (cz * wy) / wz</p>

<p>I got this from this lecturer <a href="https://www.youtube.com/watch?v=VpNJbvZhNCQ" rel="noreferrer">https://www.youtube.com/watch?v=VpNJbvZhNCQ</a>
I don't understand what he means by the variable 'd'. What would the variable 'd' be?</p>

CC BY-SA 3.0
2016-11-29T13:30:15.670Z
Once you get into this, you're going to have to come to terms with homogeneous coordinates. [Here](http://www.tomdalling.com/blog/modern-opengl/explaining-homogenous-coordinates-and-projective-geometry/) is a nice introduction to projection.
Brett Hale
<projections>
Am I calculating perspective projection correctly?
S.A
# Am I calculating perspective projection correctly?

(Asked by: username_0 on 2016-11-28)

If I have a point in world space: (wx, wy, wz)

and I have a centre of projection: (cx, cy, cz)

and I wanted to project that point using perspective projection

would my point on the screen be calculated by:

x = (cz \* wx) / wz
y = (cz \* wy) / wz

I got this from this lecturer <https://www.youtube.com/watch?v=VpNJbvZhNCQ>
I don't understand what he means by the variable 'd'. What would the variable 'd' be?

**Tags:** projections

> **Comments:**
> **username_1**: Once you get into this, you're going to have to come to terms with homogeneous coordinates. [Here](http://www.tomdalling.com/blog/modern-opengl/explaining-homogenous-coordinates-and-projective-geometry/) is a nice introduction to projection.  

---

## 1 answers

### Answer by username_2 on 2016-11-28. Score: 2 | Accepted answer

In the video you linked to, $d$ is just the distance from the eye to the image plane. To simplify things though, you can just set $d$ to 1, which is the usual case and causes it to disappear from the formulas.

Your formula for projection is a bit wrong but don't worry, projection is actually pretty simple.

$x\_{Screen} = x\_{World} / z\_{World}\\
y\_{Screen} = y\_{World} / z\_{World}$

If you want to move the center of projection, you can do so with a screen space coordinate, by modifying the formula to be this:

$x\_{Screen} = x\_{World} / z\_{World} - x\_{ScreenCenter}\\
y\_{Screen} = y\_{World} / z\_{World} - y\_{ScreenCenter}$

If you want to re-introduce the $d$ value to control the distance from the eye to the projection plane, you can use the formula below. Adjusting $d$ will make the camera look like it is zooming in or out. Again, you can just set $d$ to 1 though and not deal with it.

$x\_{Screen} = d\*x\_{World} / z\_{World} - x\_{ScreenCenter}\\
y\_{Screen} = d\*y\_{World} / z\_{World} - y\_{ScreenCenter}$


---

