# Equation for camera projection

I am trying to find an equation for a camera projection. The goal is to map the point $P(P_x, P_y, P_z)$ from the world coordinates onto the window coordinates $Q(Q_x, Q_y)$. The eye of viewing is located a distance D from the $\hat{e_1}$-$\hat{e_2}$ plane, and in the direction of -$\hat{e_3}$. $\hat{e_1}$, $\hat{e_2}$ and $\hat{e_3}$ are unit vectors.

What is the equation to map P from world coordinates to window coordinates? $\vec{Q}(Q_x, Q_y) = f(\vec{P}, \hat{e_1}, \hat{e_2}, \hat{e_3}, \vec{v}, \vec{c})$ with all the vectors on the right side described in terms of world coordinates, eg

$\vec{P} = (P_x, P_y, P_z)$

$\vec{C} = (C_x, C_y, C_z)$

$\vec{e_1} = ({e_1}_x, {e_1}_y, {e_1}_z)$

$\vec{e_2} = ({e_2}_x, {e_2}_y, {e_2}_z)$

$\vec{e_3} = ({e_3}_x, {e_3}_y, {e_3}_z)$

• If you don't know where to start, you can work on a simpler version of the problem: instead of projecting from a 3D space to a 2D screen, try projecting from 2D space to a 1D screen. Work one transformation at a time, and the equation in 2D becomes reasonably simple. Then you can redo it in 3D. – Julien Guertault Aug 27 '18 at 4:18
• By the way, the convention is usually to name the components of a vector $\vec{V} = (V_x, V_y, V_z)$ rather than $\vec{V} = (x_v, y_v, z_v)$. – Julien Guertault Aug 27 '18 at 13:49
• @raindrop - Check this link might come handy. computergraphics.stackexchange.com/questions/6365/… – gallickgunner Aug 28 '18 at 18:32