In one text, the derivation for perspective projection goes like this:
If $x',y',z'$ represent any point along the projection line,and $x_{prp},y_{prp},z_{prp}$ are the projection reference point, then:
$$x'=x-(x-x_{prp})u$$
$$y'=y-(y-y_{prp})u$$
$$z'=z-(z-z_{prp})u$$
where $0\le u \le 1$
Now, finding the value of u from the third equation above and replacing in the first and second equations, we get at $z_vp$:
$$ x_p=x'= x.\frac{z_{vp}-z_{prp}}{z-z_prp}+x_{prp}.\frac{z-z_{vp}}{z-z_{prp}}$$ $$ y_p=y'= y.\frac{z_{vp}-z_{prp}}{z-z_prp}+y_{prp}.\frac{z-z_{vp}}{z-z_{prp}}$$
and there is no projection transformation matrix given.
In the second text, the derivation is using similar triangles:
comparing the similar triangles we get:
$$x_p=\frac{-x_c}{\frac{z_c}{d}}$$
$$y_p=\frac{y_c}{\frac{z_c}{d}}$$
and the projection transformation for homogeneous coordinates x,y,z is given by: $$ \begin{bmatrix} -1&&0&&0&&0\\ 0&&1&&0&&0\\ 0&&0&&1&&0\\ 0&&0&&\frac{1}{d}&&0 \end{bmatrix} $$
so, my questions are:
- How do I find the projection matrix of coordinates as found from derivation 1?
- Both are given in the perspective projection area of these different texts, are both transformations the same? If not, how are they different?