Short formulation of the question
Is there a way to order layers in tikz-3dplot according to their distance to the observer's position? The picture should look realistic in order to give some intuition to the reader. But I prefer a solution without rearranging all items of the graphic.
Example
The following working example does not show the correct 3D view, i.e. the balls are wrong ordered in the second picture:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\begin{tikzpicture}
\node[fill=red,circle] (c1) at (0,0,0) {};
\node[fill=gray,circle] (c2) at (1,0,0) {};
\node[fill=blue,circle] (c3) at (1,0,1) {};
\node[fill=green,circle] (c4) at (0,0,1) {};
\node[fill=black,circle] (c5) at (0,1,0) {};
\node[fill=orange,circle] (c6) at (1,1,0) {};
\node[fill=yellow,circle] (c7) at (1,1,1) {};
\node[fill=magenta,circle] (c8) at (0,1,1) {};
\draw[line width=2pt] (c1) -- (c2) -- (c3) -- (c4) -- (c1);
\draw[line width=2pt] (c5) -- (c6) -- (c7) -- (c8) -- (c5);
\draw[line width=2pt] (c1) -- (c5);
\draw[line width=2pt] (c2) -- (c6);
\draw[line width=2pt] (c3) -- (c7);
\draw[line width=2pt] (c4) -- (c8);
\end{tikzpicture}
\tdplotsetmaincoords{45}{0}
\begin{tikzpicture}[tdplot_main_coords]
\node[fill=red,circle] (c1) at (0,0,0) {};
\node[fill=gray,circle] (c2) at (1,0,0) {};
\node[fill=blue,circle] (c3) at (1,0,1) {};
\node[fill=green,circle] (c4) at (0,0,1) {};
\node[fill=black,circle] (c5) at (0,1,0) {};
\node[fill=orange,circle] (c6) at (1,1,0) {};
\node[fill=yellow,circle] (c7) at (1,1,1) {};
\node[fill=magenta,circle] (c8) at (0,1,1)
\draw[line width=2pt] (c1) -- (c2) -- (c3) -- (c4) -- (c1);
\draw[line width=2pt] (c5) -- (c6) -- (c7) -- (c8) -- (c5);
\draw[line width=2pt] (c1) -- (c5);
\draw[line width=2pt] (c2) -- (c6);
\draw[line width=2pt] (c3) -- (c7);
\draw[line width=2pt] (c4) -- (c8);
\end{tikzpicture}
\tdplotsetmaincoords{54.7}{45}
\begin{tikzpicture}[tdplot_main_coords]
\node[fill=red,circle] (c1) at (0,0,0) {};
\node[fill=gray,circle] (c2) at (1,0,0) {};
\node[fill=blue,circle] (c3) at (1,0,1) {};
\node[fill=green,circle] (c4) at (0,0,1) {};
\node[fill=black,circle] (c5) at (0,1,0) {};
\node[fill=orange,circle] (c6) at (1,1,0) {};
\node[fill=yellow,circle] (c7) at (1,1,1) {};
\node[fill=magenta,circle] (c8) at (0,1,1) {};
\draw[line width=2pt] (c1) -- (c2) -- (c3) -- (c4) -- (c1);
\draw[line width=2pt] (c5) -- (c6) -- (c7) -- (c8) -- (c5);
\draw[line width=2pt] (c1) -- (c5);
\draw[line width=2pt] (c2) -- (c6);
\draw[line width=2pt] (c3) -- (c7);
\draw[line width=2pt] (c4) -- (c8);
\end{tikzpicture}
\end{document}
Further outlook
Maybe it is crucial to note that I want to use different view angles (feature of [tikz-3dplot][1]) without ordering the entire crystal with respect to the appearing layers.
