While LaTeX packages TikZ and PStricks (see previous post) extensively support 2D, the 3D support is somewhat limited: z-coordinate (depth) is not accounted for in certain cases, so the the newer object declaration or higher layer “covers” older object or lower layer.
Possible solution is using Asymptote package. It comes with additional bonuses like inlining code into TeX code, export into various image formats and even embedding PRC graphics within PDF files. Just what one needs for imaging the crystal structure! :-)