Compute the camera center of the camera and the principal axis The subject is Pinhole Camera.
I've given a camera matrix $P =  \begin{pmatrix}
    1 & 0 & 0 & 0\\
    0 & 1 & 0 & 0 \\
    0 & 0 & 1 & 1
    \end{pmatrix}$  and these $3D$ points: $X_1 = \begin{pmatrix}
    1 \\
    2  \\
   3 \\
    1
    \end{pmatrix}, X_2 = \begin{pmatrix}
    1 \\
    1  \\
   1 \\
    1
    \end{pmatrix}, X_3 = \begin{pmatrix}
    1 \\
    1  \\
   -1 \\
    1
    \end{pmatrix}$ 
I need to compute it's position (camera center) and its principal axis (viewing direction). I haven't found anything on how to compute the position and viewing direction, any help is appreciated.

As pointed out in one of the comments, the camera centre is the right null vector of the camera matrix, in other words it is the only point for which the image $P\textbf{C}$ is not defined.
If we write the camera matrix $P$ as $[M | \textbf{p}^4]$, then the (inhomogeneous) direction of the principal axis toward the front of the camera is given by det$(M)\textbf{m}^3$ where $\textbf{m}^3$ is the last row of $M$. This is because the third row of $P$ represents the principal plane of the camera and the first three coordinates together i.e. $\textbf{m}^3$ represent the direction of the normal to the principal plane (the principal axis direction).
So in this case the inhomogeneous coordinates of the camera centre are $(0, 0, -1)^T$ and principal axis is along the positive $z$ direction, $(0, 0, 1)^T$.
