1

i was wondering how i could create a perspective 2D grid like this blue one on the left:

https://tinytutorials.wordpress.com/2011/02/15/illustrator-cs5-perspective-grid-manipulating-the-perspective-grid/

with Tikz. My current approach:

\begin{tikzpicture}
    \draw[step=2.5mm,gray,very thin] (4,0) grid (7,1);
\end{tikzpicture}

Unfortunately it isn't possible to rotate the draw in 3D.

1 Answers1

7

Not very efficient. Elegance is left as an exercise for the reader.

\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}

perspective grid

cfr
  • 198,882