9

I got a 3d coordinate system and I want to mark a point with a dot.

\begin{tikzpicture}[x = {(0.866cm,0.5cm)}, y={(0cm,1cm)}, z={(0.866cm,-0.5cm)},]
\draw[thick,->] (-15,0,0) -- (15,0,0) node[right] {x};
\draw[thick,->] (0,-12,0) -- (0,12,0) node[above] {y};
\draw[thick,->] (0,0,-15) -- (0,0,50) node[right] {z};
\fill (0,0,5) circle (1);
\end{tikzpicture}

This is the result:

bad dot

but what i want is a sphere or a circle from the point of view:

good dot

How can I achieve this?

10

typical, 2 hours searching the internet. then after finally posting, 2 mins later i find the answer myself. but since it was so hard to find maybe it will be helpful to somebody else:

\begin{tikzpicture}[x = {(0.866cm,0.5cm)}, y={(0cm,1cm)}, z={(0.866cm,-0.5cm)},]
\draw[thick,->] (-15,0,0) -- (15,0,0) node[right] {x};
\draw[thick,->] (0,-12,0) -- (0,12,0) node[above] {y};
\draw[thick,->] (0,0,-15) -- (0,0,50) node[right] {z};
\draw plot [mark=*, mark size=10] coordinates{(0,0,5)}; 
\end{tikzpicture}

i dont know how it works, but it does perfectly what i wanted: enter image description here

| improve this answer | |
7

A tikz-3dplot solution that both sphere and circle, whose size can be changed, are shown here.

enter image description here

Code

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}

\tdplotsetmaincoords{120}{50}

\begin{document}

\begin{tikzpicture}[scale=2, tdplot_main_coords,axis/.style={->},thick]
\draw[axis] (-1, 0, 0) -- (1, 0, 0) node [right] {$X$};
\draw[axis] (0, -1, 0) -- (0, 3, 0) node [right] {$Z$};
\draw[axis] (0, 0, -1) -- (0, 0, 1) node [above] {$Y$};

\node[draw=none,shape=circle,fill, inner sep=2pt] (d1) at (0,1,0){};  % circle

\tdplottransformmainscreen{0}{2}{0}
\shade[tdplot_screen_coords, ball color = red] (\tdplotresx,\tdplotresy) circle (0.05);                                                                   % sphere
\end{tikzpicture}
\end{document}
| improve this answer | |
1

You can use node to put your points.

Using marks is perfect if you want to put points on lines, but if you want to put points outside of lines ...

\documentclass[tikz, varwidth, border=10]{standalone}
\begin{document}
  \begin{tikzpicture}[scale=.2, x = {(0.866cm,0.5cm)}, y={(0cm,1cm)}, z={(0.866cm,-0.5cm)}]
    \draw[thick,->] (-15,0,0) -- (15,0,0) node[right] {x};
    \draw[thick,->] (0,-12,0) -- (0,12,0) node[above] {y};
    \draw[thick,->] (0,0,-15) -- (0,0,50) node[right] {z};
    \path (0,0,5) node[circle, fill, inner sep=1]{};
    \path (1,0,5) node[circle, fill, inner sep=1]{};
  \end{tikzpicture}
\end{document}

enter image description here

Note : You can read this question/answers.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.