I am looking to reproduce the image
I am looking to improve my minimal example and ideas for the other cases:
MWE:
\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{110}
\begin{tikzpicture}[tdplot_main_coords,font=\sffamily]
\draw (0,-3,0) -- (0,3,0);
\draw (2,0,-3) -- (-2,0,3);
\draw[fill=red,opacity=0.3] (-3,0,-3) -- (-3,0,3) -- (3,0,3) -- (3,0,-3) -- cycle;
\draw (-3,0,-3) -- (-3,0,3) -- (3,0,3) -- (3,0,-3) -- cycle;
\draw[fill=blue,opacity=0.2] (-3,-3,0) -- (-3,3,0) -- (3,3,0) -- (3,-3,0) -- cycle;
\draw (-3,-3,0) -- (-3,3,0) -- (3,3,0) -- (3,-3,0) -- cycle;
\draw[fill=green,opacity=0.1] (2,-3,-3) -- (2,3,-3) -- (-2,3,3) -- (-2,-3,3) -- cycle;
\draw (2,-3,-3) -- (2,3,-3) -- (-2,3,3) -- (-2,-3,3) -- cycle;
\draw[fill=red,opacity=0.1] (-3,0,-3) -- (-3,0,3) -- (3,0,3)
-- (3,0,-3) -- cycle;
\draw[thick](-3,0,0)--(3,0,0);
\draw[thick](-3,0,0)--(3,0,0);
\fill[red] (0,0,0) circle (3pt);
\node[anchor=south west,align=center] (line) at (4,6,3.5)
{Solution\\ intersection};
\draw[-latex] (line) to[out=180,in=75] (0.05,0.05,0.1);
\end{tikzpicture}
\end{document}
This outputs:
I hope people have fun with this question.
\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{110}
\begin{tikzpicture}[tdplot_main_coords,font=\sffamily]
\draw (0,-3,0) -- (0,3,0);
\draw (2,0,-3) -- (-2,0,3);
\draw[fill=red,opacity=0.3] (-3,0,-3) -- (-3,0,3) -- (3,0,3) -- (3,0,-3) --
cycle;
\draw (-3,0,-3) -- (-3,0,3) -- (3,0,3) -- (3,0,-3) -- cycle;
\draw[fill=blue,opacity=0.2] (-3,-3,0) -- (-3,3,0) -- (3,3,0) -- (3,-3,0) --
cycle;
\draw (-3,-3,0) -- (-3,3,0) -- (3,3,0) -- (3,-3,0) -- cycle;
\draw[fill=green,opacity=0.1] (2,-3,-3) -- (2,3,-3) -- (-2,3,3) -- (-2,-3,3)
-- cycle;
\draw (2,-3,-3) -- (2,3,-3) -- (-2,3,3) -- (-2,-3,3) -- cycle;
\draw[fill=red,opacity=0.1] (-3,0,-3) -- (-3,0,3) -- (3,0,3) -- (3,0,-3) --
cycle;
\draw[thick](-3,0,0)--(3,0,0);
\draw[thick](-3,0,0)--(3,0,0);
\fill[red] (0,0,0) circle (3pt);
\node[anchor=south west,align=center] (line) at (4,6,3.5) {Solution\\
intersection};
\draw[-latex] (line) to[out=180,in=75] (0.05,0.05,0.1);
\end{tikzpicture}
\end{document}
This outputs:
Best Answer
UPDATE: Since this is a repeating question, I tried to improve on this. So far one had to order the elements of the drawing by hand. Examples of this type can be found in the lower parts of this answer. One may wonder if it is possible to let TikZ decide in which order to draw things. The answer is yes. Here is something that can be thought of as a proof of principle.
3dtools
, which can be found here. You need to save the library astikzlibrary3dtools.code.tex
and put it somewhere where TeX can find it, such as the same folder as the document below.At this point, you still need to find out what the intersection pieces are by hand. As I said, this is a proof of principle. pgfplots offers something very similar with
patchplots
.Needless to say that this can be applied to other scenarios that intersecting D-branes.
OLDER ANSWER: You need to draw the pieces of the planes in the right order. For the given view in your case this is
You need to select your favorite
fill opacity
from the loop.Here is an alternative way to make intersecting planes fully rotatable.
You "only" need to distinguish enough cases.
ADDENDUM: As for your request in the comments: the strategy is precisely the same as above.