文本已反映在 3D 图中

文本已反映在 3D 图中

看起来xz下面的3D图形的xz平面上的文字已经反射了。

怎样让它变得正常,就像yz在yz平面上一样?

3D 平面文本


可编辑ShareLaTeX 上的只读代码

\documentclass{standalone}

\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{arrows.meta}

\begin{document}
\tdplotsetmaincoords{60}{130}

\begin{tikzpicture}[scale=2,tdplot_main_coords]

\coordinate (O) at (0,0,0);
\coordinate (x) at (1,0,0);
\coordinate (y) at (0,1,0);
\coordinate (z) at (0,0,1);

\draw[thick, >=Stealth, ->] (O) -- (x) node[anchor = north]{x}; % x
\draw[thick, >=Stealth, ->] (O) -- (y) node[anchor = north]{y}; % y
\draw[thick, >=Stealth, ->] (O) -- (z) node[anchor = south]{z}; % z

\coordinate (xz) at (1,0,1);
\coordinate (yz) at (0,1,1);

% text on the yz plane
\draw[canvas is yz plane at x = 0, transform shape, draw = red, fill = red!50, opacity = 0.5] (yz) rectangle (O);
\node[canvas is yz plane at x = 0] at (0,0.5,0.5) {yz};

% text on the xz plane (Notice: it seems that the text has been reflected)
\draw[canvas is xz plane at y = 0, transform shape, draw = blue, fill = blue!50, opacity = 0.5] (xz) rectangle (O);
\node[canvas is xz plane at y = 0, align = center] at (0.5,0,0.5){xz};

\end{tikzpicture}
\end{document}

答案1

我不知道为什么它会被反射,但你可以把它反射回去

\node[canvas is xz plane at y = 0, align = center] at (0.5,0,0.5){\reflectbox{xz}};

生产

在此处输入图片描述

相关内容