[Tex/LaTex] 3d Image using tikz

3dtikz-pgf

I have attempted to draw a sphere between two planes that are defined
as follows.
a:= 2x – 2y + z + 2 = 0 and b:= 4x – 4y + 2z – 4 = 0
I know that the line is perpendicular to the two planes
are l(5+2t,-1-2t,4+t).
The sphere can be described like
(x – 5/3)^2 + (y-5/3)^2 + (z-7/3)^2 = 1^2.
So the image I am trying to create looks somewhat like this
enter image description here
Now is there any way in tikz to approach this in a good way?
I know there is the PsTricks option, but I really need the pdflatex
compability. Now I did give this a shoot, but it did not turn out great.

\documentclass{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[scale=0.25]
\tkzInit[xmin=-20,xmax=40,ymin=-20,ymax=20] \tkzClip
\tkzDefPoint(8,-2){E}  \tkzDefPoint(-2,2){D} 
\tkzDefMidPoint(E,D) \tkzGetPoint{M}
\tkzInterLC[R](E,D)(M,20 cm) \tkzGetPoints{P1}{P}
\tkzDefPoint(17,-0.8){R}
\tkzDefPoint(-20,-15){S1}  \tkzDefPoint(-5, 15){S2} 
\tkzDefPoint( 12, 20){S3}  \tkzDefPoint(-2,-10){S4}
\tkzInterLL(E,D)(S1,S2) \tkzGetPoint{T1}
\tkzDrawPolygon[color=white,fill=blue!30!white,opacity=0.7](S1,S2,S3,S4)
\tkzDrawCircle[color=red!70!black,ball color=red](M,E)
\begin{scope}[shift=(R)]
\tkzDefPoint(-20,-15){S5}  \tkzDefPoint(-5, 15){S6} 
\tkzDefPoint( 12, 20){S7}  \tkzDefPoint(-2,-10){S8}
\end{scope}
\tkzDrawLine[add=10 and 0](P,T1) 
\tkzDrawSegment[dashed](T1,E)
\tkzDrawPolygon[color=white,fill=blue!50!white,opacity=0.7](S5,S6,S7,S8)
\tkzDrawLine[add=0 and 10](E,P1) 
\tkzDrawPoints[fill=black](P,D,E) \tkzLabelPoints(P,D,E)
\tkzLabelPoint[below left](S3){\Large $\alpha$} \tkzLabelPoint[below left](S7){\Large $\beta$}
\end{tikzpicture}
\end{document}

Which produces
enter image description here
Which is not quite what I want. As well as being a very hacky, and non 3d approach to the problem. Is there any decent way to approach making planes, and spheres in tikz?

Best Answer

You could set up your own axes and use scopes to restrict the lines:

\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}

\begin{tikzpicture}[x={(0.966cm,0.259cm)},y={(-0.966cm,0.259cm)},z={(0.259cm,0.966cm)}]
\draw[->] (-2,-2,-2) -- node[fill=white] {x} ++ (2,0,0);
\draw[->] (-2,-2,-2) -- node[fill=white] {y} ++ (0,2,0);
\draw[->] (-2,-2,-2) -- node[fill=white] {z} ++ (0,0,2);

\begin{scope}
    \clip (0,3,0) -- (0,3,5) -- (0,10,5) -- (0,10,0) -- cycle;
    \draw[thick] (2.5,8,2.5) -- (2.5,3,2.5);
\end{scope}

\fill[opacity=0.5,blue] (0,3,0) -- (5,3,0) -- (5,3,5) -- (0,3,5) -- cycle;
\shade[ball color=red] (2.5,1.5,2.5) circle (1.5*1cm);
\fill[opacity=0.5,blue] (0,0,0) -- (5,0,0) -- (5,0,5) -- (0,0,5) -- cycle;

\begin{scope}
    \clip (0,0,0) -- (2.5,0,0) -- (2.5,0,5) -- (2.5,3,5) -- (0,3,5) -- (0,3,0) -- cycle;
    \draw[thick, dashed] (2.5,8,2.5) -- (2.5,0,2.5);
\end{scope}

\draw[thick] (2.5,0,2.5) -- (2.5,-5,2.5);

\end{tikzpicture}

\end{document}

enter image description here