I want to draw a series of planes in 3D, just like a picture in tikz-ducks documentation:
I thought it might be easy but I was stuck at drawing the planes in 3D. My own code:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\filldraw[
draw=red,%
fill=red!20,%
] (0,0,0)
-- (3,1,0)
-- (3,1,3)
-- (1,0,3)
-- cycle;
\end{tikzpicture}
\end{document}
which produces:
I experimented a lot but I couldn't figure out how to set these 3D coordinates. How could I draw a blue rectangle as shown in the example? Additionally how could I rotate a picture in the same way?
\draw (0,0,0) -- (0,0,1) -- (0,1,1) -- (0,1,0) -- cycle;
. In the squares in the picture you show, the x value never changes as the squares are in the yz plane (up-down and front-back).