Skip navigation

Monthly Archives: August 2012

Here is how you draw in latex in 3d using tikz




\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,3d}
\begin{document}

\section{3d picture}

\begin{tikzpicture}
% style of faces
\tikzset{facestyle/.style={fill=lightgray,draw=red,very thin,line join=round}}
% how to draw a polygon
\draw[fill=green,draw=orange,opacity=1.0,thin,line join=round]
 (0,0,0) -- 
 (1,0,0) --
 (1,1,0) --
 (0,1,0) -- cycle ;

\draw[fill=blue,draw=orange,opacity=1.0,thin,line join=round]
 (0,0,0) -- 
 (0,0,1) --
 (0,1,1) --
 (0,1,0) -- cycle ;

\draw[fill=red,draw=orange,opacity=1.0,thin,line join=round]
 (0,0,0) -- 
 (1,0,0) --
 (1,0,1) --
 (0,0,1) -- cycle ;

\draw[fill=purple,draw=orange,opacity=1.0,thin,line join=round]
 (1,0,0) -- 
 (1,0,1) --
 (0,1,1) --
 (0,1,0) -- cycle ;
\end{tikzpicture}


\end{document}




Advertisements