Another alternative from tikz-3dplot that provides more fun stuffs.
- Set the xyz coordinate system to xy coordinate system by
\tdplotsetmaincoords{90}{90}
- Draw a large square first.
- Determine the vanishing point (X) at the center of the square.
- Use
calc to determine the coordinates of a smaller box via ($(d\i)!\s!(X)$) that requires calc.
- Switch back to xyz coordinate via
\tdplotsetmaincoords{70}{120} and many other different view angles available.
- Code given below.

Code
\documentclass[border=1cm,varwidth]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{shapes,calc,positioning}
\tdplotsetmaincoords{90}{90}
% decide the focus at distance f from the square, like (10,3) of the OP
\def\f{-8} % try,10 etc
% determine the location of the smaller box
\def\s{0.7} % 0<s<1
\begin{document}
\begin{tikzpicture}[scale=2, tdplot_main_coords,axis/.style={->,dashed},thick]
\draw[axis] (3, 0, 0) -- (-3, 0, 0) node [right] {$X$};
\draw[axis] (0, 0, 0) -- (0, 3, 0) node [above] {$Y$};
\draw[axis] (0, 0, 0) -- (0, 0, 3) node [above] {$Z$};
\node[coordinate] (d1) at (2,0,0){};
\node[coordinate] (d2) at (2,2,0){};
\node[coordinate] (d3) at (2,2,2){};
\node[coordinate] (d4) at (2,0,2){};
\coordinate (X) at (\f,1,1); % change -5 to sue one's needs via \f.
\foreach \i in {1,2,3,4} {
\node[coordinate] (t\i) at ($(d\i)!\s!(X)$){};
}
% draw lines
\foreach \i in {1,2,3,4}{
\draw[color=blue] (d\i) --(X);
}
\draw [fill=yellow,opacity=1] (t1)--(t2)--(t3)--(t4)--cycle;
\draw [fill=yellow,opacity=0.5] (d1)--(d2)--(d3)--(d4)--cycle;
\end{tikzpicture}
% Try different view angle/perspective
% view from x {90}{90}
% view from y {90}{0}
% view from z {0}{90}
% view from the first quadrant {70}{120}
% view from the second quadrant {120}{70}
\tdplotsetmaincoords{70}{120}
\begin{tikzpicture}[scale=2, tdplot_main_coords,axis/.style={->,dashed},thick]
\draw[axis] (3, 0, 0) -- (-3, 0, 0) node [right] {$X$};
\draw[axis] (0, 0, 0) -- (0, 3, 0) node [above] {$Y$};
\draw[axis] (0, 0, 0) -- (0, 0, 3) node [above] {$Z$};
\node[coordinate] (d1) at (2,0,0){};
\node[coordinate] (d2) at (2,2,0){};
\node[coordinate] (d3) at (2,2,2){};
\node[coordinate] (d4) at (2,0,2){};
\coordinate (X) at (\f,1,1);
\foreach \i in {1,2,3,4} {
\node[coordinate] (t\i) at ($(d\i)!\s!(X)$){};
}
% draw lines
\foreach \i in {1,2,3,4}{
\draw[color=blue] (d\i) node[above right] {\color{red} \tiny \i} --(X);
}
\draw [fill=yellow, opacity=0.5] (d1)--(d2)--(d3)--(d4)--cycle;
\draw [fill=yellow, opacity=0.5] (t1)--(t2)--(t3)--(t4)--cycle;
\end{tikzpicture}
\end{document}
tan()does not give an angle, so perhapsatan()is the function you are looking for? :-) – Peter Grill Dec 05 '14 at 02:45\pgfmathsetmacro, but withatan(). – Peter Grill Dec 05 '14 at 02:48