Intersecting planes not shown correctly with TikZ

I made a plot in MATLAB of a deformed and an undeformed model. I converted the figure to TikZ using matlab2tikz and added it to my .tex file. I then noticed that the two configurations, which are intersecting, are not displayed correctly. To illustrate what I mean, I've stripped down the TikZ code to make to rectangles cross in a 3D space:

\begin{tikzpicture}
\begin{axis}[%
width=5cm,height=5cm,
view={-37.5}{45},
scale only axis,
xmin=-3, xmax=23,
ymin=0, ymax=20,
zmin=-5, zmax=5,
hide axis]
20 0 0\\
20 20 0\\
0 20 0\\
0 0 0\\
};

15 5 -4\\
15 15 0\\
5 15 4\\
5 5 0\\
};
\end{axis}
\end{tikzpicture}


The result looks like this:

As can be seen one plane lies entirely on top of the other, while in fact they intersect (i.e. about half of the blue plane lies 'underneath' the red plane). With my minimum TikZ knowledge I was hoping someone here could help me fix this problem, such that the planes indeed intersect.

-
As a workaround may be see 3) Fully Matlab section to export figure in a reasonable good quality, you may need to add appropriate packages in mlf2pdf.m. – texenthusiast Apr 17 '13 at 17:12

pgfplots supports z buffering techniques up to a certain extent. It works pretty well for single scatter plots (z buffer=sort), mesh or surface plots (z buffer=auto) or parametric mesh and surface plots (z buffer=sort). However, it can’t combine different \addplot commands, those will be drawn in the order of appearance. You may encounter the limitations sometimes. Maybe it will be improved in future versions.