平面上的旋转数字

平面上的旋转数字

我刚刚知道 tikz 是用来画图像的。我查看了手册,因为我想画一个这样的图像我从https://developer.apple.com/library/ios/documentation/Performance/Conceptual/vImage/ConvolutionOperations/ConvolutionOperations.html下载

我不确定 tikz 是否可以做到这一点,因为我发现网格中的数字也以某种方式旋转了。也就是说,数字似乎旋转了,这与平面一致。

我知道画一些线条,但我不知道如何写这样的文字。

任何建议都将不胜感激。

答案1

这是解决方案的开始,我用任意值填充了表格。

您必须使用命令canvas在斜面上绘制并使用transform shape作为弓节点

\documentclass{scrartcl}
 \usepackage{tikz}
 \usetikzlibrary{arrows,3d,matrix}

 % see the explanation below
 \makeatletter
 \tikzoption{canvas is xy plane at z}[]{%
   \def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}%
   \def\tikz@plane@x{\pgfpointxyz{1}{0}{#1}}%
   \def\tikz@plane@y{\pgfpointxyz{0}{1}{#1}}%
   \tikz@canvas@is@plane
 }
 \makeatother 

\begin{document}
\begin{tikzpicture}
 [x={(0.866cm,0.5cm)}, y={(-0.866cm,0.5cm)}, z={(0cm,1cm)}, scale=0.8]




    \begin{scope}[canvas is xz plane at y=0,transform shape]
      %\draw[blue] (0,0) -- (10,0)--(10,10)--(0,10)--cycle;
      \foreach \ii [count = \xi] in {1,2,3,...,8}{
            \foreach \jj  [count = \yi]in {1,2,3,...,8}{
            \pgfmathsetmacro{\nn}{int(\xi+8*\yi-8)}
      \node[red,draw,minimum size=1cm] (n\nn-1) at (\ii,-\jj) {\nn};
      }
      }

      \end{scope}

        \begin{scope}[canvas is xz plane at y=-7.3,transform shape]
      \foreach \ii [count = \xi] in {1,2,3}{
            \foreach \jj  [count = \yi]in {1,2,3}{
            \pgfmathsetmacro{\nn}{int(\xi+3*\yi-3)}
      \node[blue,draw,minimum size=1cm] (n\nn-2) at (\ii,-\jj) {\nn};
      }
      }
      \end{scope} 

      \begin{scope}[canvas is xz plane at y=-11.2,transform shape]
      \foreach \ii [count = \xi] in {1,2,3,...,8}{
            \foreach \jj  [count = \yi]in {1,2,3,...,8}{
            \pgfmathsetmacro{\nn}{int(\xi+8*\yi-8)}
      \node[green,draw,minimum size=1cm] (n\nn-3) at (\ii,-\jj) {\nn};
      }
      }
      \end{scope} 

      \draw[fill=red!50,opacity=0.3] (n10-1.north east) -- (n5-2.north east) --(n10-3.north east)
      --(n10-3.north west)-- (n5-2.north west) --  (n10-1.north west)  ;
      \draw[fill=red!50,opacity=0.3] (n10-1.south east) -- (n5-2.south east) --(n10-3.south east)
      --(n10-3.south west)-- (n5-2.south west)-- (n10-1.south west)  ;    
      \draw[fill=red!50,opacity=0.3] (n10-1.north east) -- (n5-2.north east) --(n10-3.north east)
      --(n10-3.south east)-- (n5-2.south east)-- (n10-1.south east)  ;

      \draw[fill=red!50,opacity=0.3] (n10-3.north west)-- (n5-2.north west) --  (n10-1.north west) -- (n10-1.south west)-- (n5-2.south west)   --(n10-3.south west) ;        

  \end{tikzpicture}

  \end{document}

在此处输入图片描述

相关内容