我想知道如何才能创建一个perspective 2D grid
像左边这样的蓝色的:
与Tikz
。我目前的做法是:
\begin{tikzpicture}
\draw[step=2.5mm,gray,very thin] (4,0) grid (7,1);
\end{tikzpicture}
不幸的是,无法以draw
3D 形式旋转。
答案1
效率不高。优雅程度留给读者练习吧。
\documentclass[border=10pt,x11names,dvipsnames,svgnames]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \i [count=\ino from 0] in {-5,-4,...,5}
{
\draw [Cerulean] (\i,-10,0) -- (0,0,0) \foreach \j in {0,...,10} {coordinate [pos={\j/10}] (c-\ino-\j)};
}
\foreach \i in {0,...,7} \draw [Cerulean] (c-10-\i) -- (c-0-\i);
\draw [Cerulean] (c-0-0) -- ++(0,7,0) \foreach \j in {0,...,7} {coordinate [pos={\j/7}] (a\j)} -- (0,0,0) \foreach \i in {0,...,10} {coordinate [pos={\i/10}] (b\i)};
\foreach \i in {1,...,7} \path (a\i) -- (0,0,0) \foreach \j in {0,...,10} {coordinate [pos={\j/10}] (d-\i-\j)};
\foreach \i in {1,...,7} \draw [Cerulean] (a\i) -- (d-\i-7) (c-0-\i) -- (b\i);
\end{tikzpicture}
\end{document}