Consider the side-view of a perspective camera shown below: the image looks at the \(yz\) plane from the \(+x\) direction. The scene point at \((x_c, y_c, z_c)\) appears in the viewport at \((x', y', n)\). Based on this view, calculate the value of \(y'\), the \(y\) coordinate of the viewing ray’s intersection with the viewport, in terms of the pixel’s 3D coordinates \((x_c, y_c, z_c)\) and the camera’s near clipping plane at \(z=n\). Note that \(n\) is taking over the role of the perspective camera’s focal distance \(d\), the only difference being that \(n\) is a \(z\) coordinate and is negative (because we look down the negative \(z\) axis), whereas \(d\) was just an unsigned distance. Hint: no trig necessary! Try similar triangles.
Which of the following 3D homogeneous 4-vectors represent the same point as the point \(\mathbf{x} = [0, 2, 3, 1]^T\)?
Given your answer from #1 above and the newly bestowed power to modify the bottom row of a 4x4 transformation matrix, find a perspective projection matrix that accomplishes what we set out to do in the \(x\) and \(y\) dimensions. Hint: try writing a matrix that yields coordinates with no division, but that normalizes to the coordinates we want.
\[ \begin{bmatrix} \frac{nx}{z}\\ \frac{ny}{z}\\ ?\\ 1 \end{bmatrix} \sim \begin{bmatrix} nx\\ ny\\ ?\\ z \end{bmatrix} = \begin{bmatrix} &&&&&&&&&&&\\ \\ \\ \\ \end{bmatrix} \begin{bmatrix} x_c\\ y_c\\ z_c\\ 1\\ \end{bmatrix} \]
Start by ignoring the third row of the matrix; if you get the rest of the rows, think about how we might be able to preserve the \(z\) coordinate through this transformation.