答案1
我建议使用该tikz-3dplot
软件包。无需考虑所有细节,您可以使用类似以下方法获得第一张图片:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
% Plot display orientation
\tdplotsetmaincoords{65}{115}
\definecolor{pyramidblue}{RGB}{19,131,183}
\begin{document}
\begin{tikzpicture}[tdplot_main_coords]
\fill[canvas is xy plane at z=0,pyramidblue,fill opacity=0.5] (-2,-2) rectangle (2,2);
\draw[canvas is xy plane at z=0,thick,pyramidblue,dashed] (2,-2) -- (-2,-2) -- (-2,2);
\draw[canvas is xy plane at z=0,thick,pyramidblue] (2,-2) -- (2,2) -- (-2,2);
\draw[thick,pyramidblue,dashed](-2,-2,0) -- (-1,-1,3);
\draw[thick,pyramidblue](2,-2,0) -- (1,-1,3);
\draw[thick,pyramidblue](-2,2,0) -- (-1,1,3);
\draw[thick,pyramidblue](2,2,0) -- (1,1,3);
\draw[canvas is xy plane at z=3,thick,pyramidblue,fill,fill opacity=0.5] (-1,-1) rectangle (1,1);
\end{tikzpicture}
\end{document}