我知道一个人可以写作(甚至画)在立体面上按照透视图进行操作,就像
从绘制立方体的假(2 维)表示的代码中获得:
\documentclass[tikz,border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\begin{scope}[every node/.append style={yslant=-0.5},yslant=-0.5]
\shade[right color=gray!10, left color=black!50] (0,0) rectangle +(3,3);
\node at (1.5,1.5) {\Huge 2};
\end{scope}
\begin{scope}[every node/.append style={yslant=0.5},yslant=0.5]
\shade[right color=gray!70,left color=gray!10] (3,-3) rectangle +(3,3);
\node at (4.5,-1.5) {\Huge 1};
\end{scope}
\begin{scope}[every node/.append style={yslant=0.5,xslant=-1},yslant=0.5,xslant=-1]
\shade[bottom color=gray!10, top color=black!80] (6,3) rectangle +(-3,-3);
\node at (4.5,1.5) {\Huge 3};
\end{scope}
\end{tikzpicture}
\end{document}
是否可以覆盖如下图像:
比如说,在立方体的两个面之上?
我知道覆盖情节但在这里不太适用。
答案1
\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}[inner sep=0pt, outer sep=0pt, line join=bevel]
\node[draw, ultra thick, anchor=north east, yslant=-0.5] {\includegraphics[viewport={3.2cm 1.6cm 8.2cm 6.6cm}, clip]{example-image-a}};
\node[draw, ultra thick, anchor=north west, yslant=0.5] {\includegraphics[viewport={3.2cm 1.6cm 8.2cm 6.6cm}, clip]{example-image-b}};
\node[draw, ultra thick, anchor=south west, yslant=0.5, xslant=-1] {\includegraphics[viewport={3.2cm 1.6cm 8.2cm 6.6cm}, clip]{example-image-c}};
\end{tikzpicture}
\end{document}
编辑:
您可以使用tikz-3dplot
手动方式slant
更改视角\tdplotsetmaincoords{80}{110}
\documentclass[tikz, border=1cm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{80}{110}
\begin{tikzpicture}[tdplot_main_coords, inner sep=0pt, outer sep=0pt, line join=bevel]
\node[draw, ultra thick, transform shape, canvas is yz plane at x=1] {\includegraphics[scale=0.4, viewport={3.2cm 1.6cm 8.2cm 6.6cm}, clip]{example-image-a}};
\node[draw, ultra thick, transform shape, canvas is xz plane at y=1] {\includegraphics[scale=0.4, viewport={3.2cm 1.6cm 8.2cm 6.6cm}, clip]{example-image-b}};
\node[draw, ultra thick, transform shape, canvas is xy plane at z=1] {\includegraphics[scale=0.4, viewport={3.2cm 1.6cm 8.2cm 6.6cm}, clip]{example-image-c}};
\end{tikzpicture}
\end{document}
编辑:
\documentclass[tikz, border=1cm]{standalone}
\usepackage{tikz-3dplot}
\usepackage{adjustbox}
\begin{document}
\tdplotsetmaincoords{70}{110}
\begin{tikzpicture}[tdplot_main_coords, inner sep=0pt, outer sep=0pt, line join=bevel]
\node[draw, thick, transform shape, canvas is yz plane at x=1] {\adjustbox{trim={0.250\width} {0.333\height} {0.500\width} {0.333\height}, clip}{\includegraphics[width=8cm]{ulvyP.png}}};
\node[draw, thick, transform shape, canvas is xz plane at y=1, xscale=-1] {\adjustbox{trim={0.500\width} {0.333\height} {0.250\width} {0.333\height}, clip}{\includegraphics[width=8cm]{ulvyP.png}}};
\node[draw, thick, transform shape, canvas is xy plane at z=1, rotate=90] {\adjustbox{trim={0.250\width} {0.666\height} {0.500\width} {0.000\height}, clip}{\includegraphics[width=8cm]{ulvyP.png}}};
\end{tikzpicture}
\end{document}