I apologize if this has an answer elsewhere; I've looked at many questions and could not find a solution.
Here are some of the posts I looked at (maybe they do answer it and I'm just not smart enough to see it – that's always possible):
- Drawing simple 3D cylinders in TikZ
- 3D bodies in TikZ
- Draw a 3D sphere with radius with TikZ?
- Drawing a circle on a non xy-plane with TikZ
I even looked at the rotate=
option described in this article to no avail: https://latexdraw.com/rotate-a-path-around-a-point-double-pendulum-case/
My question is this: How can you rotate a TikZ path in 3D? If this is impossible, then how can you fill a 3D sphere to achieve the same effect? If both of these ideas are impossible of execution, then how can I do this? For instance, do I need to "use a sledgehammer to crack a nut" and use TikZ-3Dplot? I'm willing to do whatever it takes. Thank you in advance for your help.
As you can see, the ellipse is parallel with the xy-plane. My goal is to rotate this ellipse – or just draw it as a sphere, if possible – so that it appears as a circle to the viewer.
MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{perspective}
\begin{document}
\begin{tikzpicture}[3d view={125}{30}, scale=4]
\draw[thick, -latex] (0,0,0) -- (2,0,0) node[pos=1,above left]{$x$};
\draw[thick, -latex] (0,0,0) -- (0,2,0) node[pos=1,below left]{$y$};
\draw[thick, -latex] (0,0,0) -- (0,0,2) node[pos=1,left]{$z$};
\node[above left] at (0,0,0) {$O$};
\draw[red,thick] (0,0,0) -- node[pos=0.5,above left] {\color{black}$a$} (0.65,0,0) -- node[pos=0.5,below left] {\color{black}$b$} (0.65,0.75,0) -- node[pos=0.5,right] {\color{black}$c$} (0.65,0.75,1.2);
\fill[red] (0.65,0.75,1.2) circle [radius=0.5];
\foreach \x in {0,0.05,...,2}{
\draw[thin] (\x,0,1.2) -- (\x,2,1.2);
\draw[thin] (0,\x,1.2) -- (2,\x,1.2);}
%\fill[red,3d view={0}{0}] (0.65,0.75,1.2) circle [radius=0.03]; % I would like to do something like this
\end{tikzpicture}
\end{document}
Thanks!
Best Answer
This one could be a (simplified) answer to Your's question:
Code: