2
$\begingroup$

Assume the screen is axis aligned with origin at 0 and there is absolutely no view transformation.

in other words we will simply try to project the model onto the screen plane following perspective. Say our FOV is 60 degrees, so the focal length is tan(30).

I am given a vertex $V=(x,y,z)$

is the projected vertex $V_p = V/(z*tan(30))$ or $V_p = V/(z/tan(30))$

$\endgroup$
3
  • $\begingroup$ How is this more directly than any other method? $\endgroup$
    – joojaa
    Commented Oct 18, 2018 at 17:00
  • 1
    $\begingroup$ Think about it like this. If you increase 30 to 40, do you want your x,y numbers to get bigger or smaller? I think smaller. (wider field of view makes an objects appear smaller) So you want a bigger number in the denominator. so you want the first one. (z * tan(30)) $\endgroup$
    – Wyck
    Commented Oct 18, 2018 at 17:23
  • $\begingroup$ I expect a simplified answer to this. I understand the question but not well enough to know what transform to apply to the vertex. $\endgroup$ Commented Oct 24, 2018 at 17:09

1 Answer 1

3
$\begingroup$

Copying this from another thread where i posted this as the answer but as Wyck suggested, the correct answer is the first one.

There is the whole derivation of it but I'll be discussing a brief overview. This is for the perspective projection where the line joining the eye and the center of the projection/image plane is perpendicular to it. Like here

enter image description here

As we can easily see, by similar triangles $\triangle ABC$ and $\triangle AEF$ we have

$Y_p / Y = D/-Z$

where $Y_p$ is the projected $Y$ coordinate on to the image plane. $AB = D$ is the total distance from eye to the image plane and is usually set to 1.

Hence we have,

$Y_p = (Y*D)/-Z$

We can easily ee from here that,

$tan(\theta_{fov}/2) = 1/AB$

$tan(\theta_{fov}/2) = 1/D$

$D = 1 /tan(\theta_{fov}/2)$

Hence we have, $Y_p = \frac{Y}{-Z*tan(\theta_{fov}/2)}$

For more details check the complete answer here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.