* You have a point $P =\begin{pmatrix} x \\\ y \\\ z \end{pmatrix}$ in your 3d scene. Add a $1$ to get $P' = \begin{pmatrix} x \\\ y \\\ z \\\ 1 \end{pmatrix}$.
* Multiply $P'$ with the projection matrix $\scriptstyle\begin{pmatrix} 1 & 0 & 0 & 0 \\\ 0 & 1 & 0 & 0 \\\ 0 & 0 & 1 & 0 \\\ 0 & 0 & 1 & -d \end{pmatrix} $ to get $P'' = \begin{pmatrix} x\\\ y \\\ z \\\ z-d \end{pmatrix}$
* Divide $P''$ by $w''= z-d $ to get $P''' = \begin{pmatrix} x/(z-d) \\\ y/(z-d) \\\ z/(z-d) \\\ 1 \end{pmatrix}$
* If $x'',y'',z'' \in [-1,1]$, print the point at the position $(x'',y'')$ on the screen.
Can you find back the position of the 9 points of the frustrum from those transformation ?