使球体看起来圆润

使球体看起来圆润
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz,tikz-3dplot}

\begin{document}

\tdplotsetmaincoords{60}{150} 
\begin{tikzpicture} [scale=1.5, tdplot_main_coords, axis/.style={->,black,thick}, 
vector/.style={red,very thick}]
%standard tikz coordinate definition using x, y, z coords
%tikz-3dplot coordinate definition using x, y, z coords
\pgfmathsetmacro{\ax}{0.5}
\pgfmathsetmacro{\ay}{0.5}
\pgfmathsetmacro{\az}{0.5}
\pgfmathsetmacro{\bx}{0.25}
\pgfmathsetmacro{\by}{1}
\pgfmathsetmacro{\bz}{1}
\coordinate (P) at (\ax,\ay,\az);
\coordinate (Q) at (\bx,\by,\bz);
%draw axes
\draw[axis] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
\draw[axis] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
\draw[axis] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};

%draw a vector from O to P
\draw[vector] (P) -- (Q);
\shade[ball color = gray!40, opacity = 0.4] (\ax,\ay,\az) circle (0.75);
\draw (\ax,\ay,\az) circle (0.75);

%draw guide lines to components
\node[tdplot_main_coords,anchor=east]
at (\ax,\ay,\az){$\left(a,b,c\right)$};
\node[tdplot_main_coords,anchor=south west]
at (\bx,\by,\bz){$\left(x,y,z\right)$};
\node[tdplot_main_coords,anchor=south west]
at (0.2,0.4,0.3){$r$};
\end{tikzpicture}

\end{document}

它与 tdplotsetmaincoords 有关,但我如何让这个球体看起来是圆形的?这可能是因为我使用的是圆形,它应该是实际的 3D 物体。

相关内容