可以使用 addplot3 进行旋转吗?

可以使用 addplot3 进行旋转吗?

我正在尝试将圆形象限绕 xy 平面上的对角线旋转。我尝试使用以下代码,但\tdplotsetrotatedcoords没有成功。这可能吗?

\documentclass[border=4pt]{standalone}
\usepackage{pgfplots}
\usepackage{amsmath}
\usepackage{tikz-3dplot}
\usepackage{fix-cm}
\usepgfplotslibrary{colormaps,external}
\usetikzlibrary{calc,3d,shapes.geometric}
\usetikzlibrary{arrows,decorations.markings,plotmarks}

\tdplotsetmaincoords{45}{150}%

\begin{document}

\begin{tikzpicture}[tdplot_main_coords]

\begin{axis}[
    axis equal,
    axis lines = center,
    width = 8cm,
    height = 8cm,
    view/h=25,
    axis lines=none
]

      \draw [->,black] (axis cs:0,0,0) -- (axis cs:20,0,0);
      \draw [->,black] (axis cs:0,0,0) -- (axis cs:0,0,20);
      \draw [->,black] (axis cs:0,0,0) -- (axis cs:0,-20,0);  

      \tdplotsetrotatedcoords{20}{20}{0}%     

      \addplot3[tdplot_rotated_coords, surf, opacity = 0.1, fill 
      opacity = 0.5,
      samples=16,domain=0:15.0,
      y domain=-0.5*pi:0,z buffer=sort,color=gray!60!white]
      (x, {sqrt( 15*15-x^2 ) * sin(deg(y))}, 0);

\end{axis}
\end{tikzpicture}
\end{document}

相关内容