I would like to draw an Octahedron using TikZ
, I found nowhere to start, I tried drawing 6 points and then connecting them properly, but this method gives no 3D feel at all, this is my drawing:
\begin{tikzpicture}[scale=3]
\coordinate (A1) at (0,0);
\coordinate (A2) at (0.6,0.2);
\coordinate (A3) at (1,0);
\coordinate (A4) at (0.4,-0.2);
\coordinate (B1) at (0.5,0.5);
\coordinate (B2) at (0.5,-0.5);
\draw[dashed] (A1) -- (A2) -- (A3);
\draw (A1) -- (A4) -- (A3);
\draw[dashed] (B1) -- (A2) -- (B2);
\draw (B1) -- (A4) -- (B2);
\draw (B1) -- (A1) -- (B2) -- (A3) --cycle;
\end{tikzpicture}
I wonder how can I add shading to each surface, and make each surface semi-transparent, also adjust the invisible edges' color lighter from the observer perspective, like the one on the wikipedia page:
So my question is: How to polish my TikZ
drawing to make a polyhedron look like a 3D object? or is there a package other than TikZ
could do that? Thanks
Best Answer
You can use the
fill
andopacity
constructs: