答案1
既然你说你也对 Ti 持开放态度钾Z,这是一个基于较早的答案。
\documentclass[tikz,border=3.14pt]{standalone}
\begin{document}
% starting point: https://tex.stackexchange.com/a/174424/121799
\begin{tikzpicture}[line join = round, line cap = round]
\pgfmathsetmacro{\factor}{1/sqrt(2)};
\coordinate [label=right:A] (A) at (2,0,-2*\factor);
\coordinate [label=left:B] (B) at (-2,0,-2*\factor);
\coordinate [label=above:C] (C) at (0,2,2*\factor);
\coordinate [label=below:D] (D) at (0,-2,2*\factor);
\coordinate (ABC) at (barycentric cs:A=1,B=1,C=1);
\coordinate (ABD) at (barycentric cs:A=1,B=1,D=1);
\coordinate (ACD) at (barycentric cs:A=1,C=1,D=1);
\coordinate (BCD) at (barycentric cs:B=1,C=1,D=1);
\draw[-latex] (ABC) -- ++(ABC);
\draw[-latex] (ABD) -- ++(ABD);
\draw[-latex] (0,0) -- (3,0,0) node[right] {$x$};
\draw[-latex] (0,0) -- (0,3,0) node[above] {$y$};
\draw[-latex] (0,0) -- (0,0,3) node[below left] {$z$};
\foreach \i in {A,B,C,D}
\draw[dashed] (0,0)--(\i);
\draw[-, fill=red!30, opacity=.5] (A)--(D)--(B)--cycle;
\draw[-, fill=green!30, opacity=.5] (A) --(D)--(C)--cycle;
\draw[-, fill=purple!30, opacity=.5] (B)--(D)--(C)--cycle;
\draw[-latex] (ACD) -- ++(ACD);
\draw[-latex] (BCD) -- ++(BCD);
\end{tikzpicture}
\end{document}
缺点是你需要按照“正确”的顺序绘制。如果你不喜欢这样做,你可以使用渐近线。如果你想改变视角,你可以使用包来实现tikz-3dplot
。