Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to draw a 3d arrow in a 3d box (well lots of them actually). I've got the 3d box sorted, but the arrow doesn't look quite right. I've set up my axes/projection with:

\usepackage{tikz-3dplot}
\tdplotsetmaincoords{90}{90}
\tdplotsetrotatedcoords{0}{20}{70}

But the arrows don't obey the projection, they're 2d but don't look flat on the xy plane of the box, they're still flat with respect to the page. Does anyone know how to fix this?

Also, ideally I'm looking for a big 3d block arrows but I can't find any examples of this, any ideas?

Cheers.

Edit: As requested, here's a MWE:

\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\tikzset{>=latex}

\usepackage{tikz-3dplot}
\tdplotsetmaincoords{90}{90}
\tdplotsetrotatedcoords{0}{20}{70}

\begin{document}
\begin{tikzpicture}
\begin{scope}[fill={rgb:red,1;green,2;blue,10},fill opacity=0.4]
\draw [fill] (0,0,0)--(4,0,0)--(4,4,0)--(0,4,0)--cycle;
\draw [fill] (0,0,0)--(4,0,0)--(4,0,1)--(0,0,1)--cycle;
\draw [fill] (0,0,0)--(0,4,0)--(0,4,1)--(0,0,1)--cycle;
\draw [fill] (4,0,0)--(4,4,0)--(4,4,1)--(4,0,1)--cycle;
\draw [fill] (4,4,0)--(0,4,0)--(0,4,1)--(4,4,1)--cycle;
\draw [fill] (0,0,1)--(4,0,1)--(4,4,1)--(0,4,1)--cycle;
\end{scope}

\begin{scope}[->, ultra thick]
\draw[->] (2,2,1/2)--++(180:1.5)--++(0:3);
\end{scope}
\end{tikzpicture}
\end{document}

The result:

Hopefully you can see the problem, it doesn't look like the arrow is in the box, it's just been laid over the top.

share|improve this question
2  
Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  egreg Dec 21 '13 at 22:42
    
Possibly relevant (but not a duplicate): tex.stackexchange.com/q/51340/484 –  Charles Staats Dec 23 '13 at 16:54
    
I am also interested in an answer to his question if it would include a 3D shaped arrow with cylindric rod too. @user3087409: TikZ creates the picture layer by layer, so the code after creating the box will lay on top of it. –  strpeter Dec 31 '13 at 9:42
1  
@strpeter a 3d arrow with cylindrical rod would be perfect. I'm fine with the code after the box laying stuff on top, but I don't want it to look like that's happening. –  user3087409 Jan 2 at 11:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.