[texhax] 3D rotation

Martin Heller mr_heller at yahoo.dk
Thu Jun 2 22:53:58 CEST 2011


On 2011-05-31 08:33, Mike B. wrote:

> Do these packages work on no-pstricks objects? from a quick look in the manuals it looks like they don't.
> will 3d rotation/tilting work inside a tikz picture?.

You can apply coordinate transformations with TikZ:

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
    \draw[thick,->,black] (0,0,0) -- (4,0,0) node[anchor=north east]{$x$};
    \draw[thick,->] (0,0,0) -- (0,2,0) node[anchor=north east]{$y$};
    \draw[thick,->] (0,0,0) -- (0,0,2) node[anchor=east]{$z$};
    \draw (1,1,0) rectangle ++(2,1,0);
\end{tikzpicture}


\begin{tikzpicture}[cm={-1,-1,0,1,(0,0)},z=1cm,x=3.85mm]
    \draw[thick,->,black] (0,0,0) -- (4,0,0) node[anchor=north east]{$x$};
    \draw[thick,->] (0,0,0) -- (0,2,0) node[anchor=north east]{$y$};
    \draw[thick,->] (0,0,0) -- (0,0,2) node[anchor=east]{$z$};
    \draw (1,1,0) rectangle ++(2,1,0);
\end{tikzpicture}

\end{document}



More information about the texhax mailing list