让跳伞更加逼真

让跳伞更加逼真

考虑以下 MWE:

\documentclass[export,border=5pt,tikz]{standalone}
\usetikzlibrary{decorations.text,calc}
\begin{document}
\foreach \n in {0,1,...,10}
{
    \begin{tikzpicture}
    \useasboundingbox (-7,-10) rectangle (8,8);
%       \pgfmathsetmacro{\w}{(-1)^\n * (\q/20)}
        \pgfmathsetmacro{\w}{4*cos(\n r)*\n}
        \begin{scope}[xshift=-.5cm,yshift=-\n cm,rotate=\w]
            \draw (0,0) circle(.5);
            \draw (0,-.5) --+ (0,-1.5) --+ (.5,-2);
            \draw (0,-2) --+ (-.5,-.5);
                \draw (-1,0) -- (0,-1) --+ (1,1);
            \fill[black,radius=.05] (-1,0) circle;
            \fill[black,radius=.05] (1,0) circle;
                \draw (-1,0) --+ (.5,2);
                \draw (1,0) --+ (-.5,2);
            \draw[yshift=1.3cm,fill=red] (.8,0) arc(0:180:.8) arc(0:-180:.1) arc(-180:-360:1) arc(0:-180:.1);
    %           \node
            \path[thick,postaction={decorate,decoration={text along path,text align=center,text={|\tiny\color{white}\bf|TeX.SX}}}] (1,1.13) arc(0:-540:1);
        \end{scope}

    \begin{scope}[xshift=-.5*\n cm]
        \fill[yshift=6cm,rotate around={(45:(1,0))},rounded corners=.5cm] (0,0) rectangle (2,-4);

        \fill[xshift=-5cm,yshift=5cm,rounded corners=.5cm,black] (0,0) rectangle (10,2);
        \foreach \x in {0,1,...,8}
        {
            \fill[xshift=\x cm,white,xshift=-4.4cm,yshift=6.3cm,rounded corners=.1cm] (0,0) rectangle (.7,.5);
        }
        \draw[xshift=-3.5cm,yshift=5.05cm,line width=3pt] (0,0) --+ ([yshift=.1*\n cm]2,-.5);
        \draw[xshift=2.5cm,yshift=5.05cm,line width=3pt] (0,0) --+ ([yshift=.1*\n cm]-2,-.5);

        \node at (7.3,6) (a) {\large \TeX.SX rocks!!!};
            \draw[thick] ([xshift=-.1cm]a.north west) -- ($(a.north west)!.2!(a.south west)$) -- ($(a.south west)!.2!(a.north west)$) -- ([xshift=-.1cm]a.south west) -- ([xshift=.1cm]a.south east) -- ($(a.south east)!.2!(a.north east)$) -- (a.north east) -- ([xshift=.1cm]a.north east) -- cycle;
                \draw ([yshift=-.2cm]a.north west) --+ (-2,0);
                \draw ([yshift=.2cm]a.south west) --+ (-2,0);
    \end{scope}
    \end{tikzpicture}
}
\end{document}

截屏

我的问题是:

  • 那“拉”怎么会node在风中如窦般移动呢?
  • 火柴人怎样才能以“之字形圆形”的方式向下移动(想象火柴人以之字形的方式向下移动,但之字形线的两个连续点之间的边缘是圆的)?

编辑:为了J Leon V.

\documentclass[border=5pt,tikz]{standalone}
\begin{document}
    \begin{tikzpicture}
        \begin{scope}
            \clip[draw] [xshift=-2cm,yshift=-3.5cm] (1,-.3) .. controls (-3,1) and (-2,-2) .. (-.5,-3) --+ (-.7,0) arc(90:180:.9) to[bend right=5] (.35,-3.9);
                    \draw[xshift=-1.5cm,yshift=-4.5cm] (-.4,0) to[bend right=10] (-1.5,.2);
                \draw[xshift=-3.7cm,yshift=-7.5cm] (0,0) to[bend left=10] (0,.5);
                \draw[xshift=-3.4cm,yshift=-7.5cm] (0,0) to[bend left=10] (0,.5);
        \end{scope}
            \draw[xshift=2cm,yshift=-6cm,double distance=1mm] (-.25,-.25) .. controls (1.5,-.25) and (1,1) .. (0,1.5);
        \begin{scope}[xscale=-1,xshift=1cm]
        \draw[xshift=-2.5cm,yshift=-5.5cm,double distance=1mm,rotate=140] (0,0) .. controls (1,1) and (2,-1) .. (4,0);
        \fill[xshift=-2cm,yshift=-3.5cm,white] (1,-.3) .. controls (-3,1) and (-2,-2) .. (-.5,-3) --+ (-.7,0) arc(90:180:.9) to[bend right=5] (.35,-3.9);
            \clip[draw] [xshift=-2cm,yshift=-3.5cm] (1,-.3) .. controls (-3,1) and (-2,-2) .. (-.5,-3) --+ (-.7,0) arc(90:180:.9) to[bend right=5] (.35,-3.9);
                    \draw[xshift=-1.3cm,yshift=-4.5cm] (-.4,0) to[bend right=10] (-1.5,.2);
                \draw[xshift=-3.7cm,yshift=-7.5cm] (0,0) to[bend left=10] (0,.5);
                \draw[xshift=-3.4cm,yshift=-7.5cm] (0,0) to[bend left=10] (0,.5);
        \end{scope}
        \begin{scope}
            \clip[draw] [xshift=-1cm,yshift=.6cm] (0,0) to[bend left=10] (-1,.5) arc(90:270:.4);
                \draw[scale=.9,xshift=-1.2cm,yshift=.5cm] (0,0) to[bend left=10] (-1,.5) arc(90:270:.4);
        \end{scope}
        \begin{scope}[xshift=-1.1cm]
            \clip[draw] [xscale=-1,xshift=-1cm,yshift=.6cm] (0,0) to[bend left=10] (-1,.5) arc(90:270:.4);
                \draw[xscale=-1,scale=.9,xshift=-1.2cm,yshift=.5cm] (0,0) to[bend left=10] (-1,.5) arc(90:270:.4);
        \end{scope}
            \draw[xshift=-1.8cm,yshift=-3.6cm] (0,0) --+ (-.4,-3.5);
            \draw[xshift=.6cm,yshift=-3.6cm] (0,0) --+ (.4,-3.5);
        \draw[fill=white,xscale=1.2,xshift=-.53cm,yshift=-1.2cm] (.05,2) to[bend right=5] (-.4,1.95) to[bend left=10] (-.1,1.93) to[bend right=10] (-1,1.65) --+ (.2,0) to[bend right=10] (-1.4,1.4) to[bend left=10] (-1.1,1.4) to[bend right=10] (-1.6,.8) to[bend left=10] (-1.4,.8) to[bend right=10] (-1.7,0) to[bend left=10] (-1.4,.1) to[bend right=10] (-1.6,-.7) to[bend left=10] (-1.4,-.5) to[bend right=10] (-1.4,-1.2) to[bend left=5] (-1.2,-1) to[bend right=10] (-1.3,-1.8) to[bend left=5] (-1.2,-1.7) to[bend right=10] (-1.2,-2.3) to[bend left=5] (-1,-2) to[bend right=10] (-1,-2.7) to[bend left=10] (-.8,-2.4) to[bend right=10] (-.7,-3.2) to[bend left=5] (-.5,-2.7) to[bend right=10] (.07,-3.4);
            \draw[fill=white,xscale=-1.2,xshift=.48cm,yshift=-1.2cm] (.05,2) to[bend right=5] (-.4,1.95) to[bend left=10] (-.1,1.93) to[bend right=10] (-1,1.65) --+ (.2,0) to[bend right=10] (-1.4,1.4) to[bend left=10] (-1.1,1.4) to[bend right=10] (-1.6,.8) to[bend left=10] (-1.4,.8) to[bend right=10] (-1.7,0) to[bend left=10] (-1.4,.1) to[bend right=10] (-1.6,-.7) to[bend left=10] (-1.4,-.5) to[bend right=10] (-1.4,-1.2) to[bend left=5] (-1.2,-1) to[bend right=10] (-1.3,-1.8) to[bend left=5] (-1.2,-1.7) to[bend right=10] (-1.2,-2.3) to[bend left=5] (-1,-2) to[bend right=10] (-1,-2.7) to[bend left=10] (-.8,-2.4) to[bend right=10] (-.7,-3.2) to[bend left=5] (-.5,-2.7) to[bend right=10] (-.015,-3.4);
                \draw[rounded corners=1pt] (-.55,-.13) .. controls (-.7,-.12) and (-1,-.2) .. (-1.5,0) .. controls (-1.9,-1) and (-1.9,-1) .. (-1.9,-2) to[bend right=5] (-1.5,-2.1) to[bend right=5] (-1.4,-2.8) to[bend right=5] (-.55,-3);
                \draw (-1.4,-2.78) --+ (.06,-.5) to[bend right=5] (-.55,-3.4);
                    \draw[xshift=-1.2cm,yshift=-2.96cm] (0,.1) to[bend left=5] (.1,.5) to[bend right=5] (.2,.04);
                \draw (-1.1,-.8) circle(.4);
                \draw (-1,-.8) circle(.1);
                    \draw[xshift=-.7cm,yshift=-2cm] (.15,0) to[bend left=5] (-.5,.2) to[bend right=5] (.15,-.15);
                \begin{scope}[xscale=-1,xshift=1.1cm]
                    \draw[rounded corners=1pt] (-.55,-.13) .. controls (-.7,-.12) and (-1,-.2) .. (-1.5,0) .. controls (-1.9,-1) and (-1.9,-1) .. (-1.9,-2) to[bend right=5] (-1.5,-2.1) to[bend right=5] (-1.4,-2.8) to[bend right=5] (-.55,-3);
                    \draw (-1.4,-2.78) --+ (.06,-.5) to[bend right=5] (-.55,-3.4);
                        \draw[xshift=-1.2cm,yshift=-2.96cm] (0,.1) to[bend left=5] (.1,.5) to[bend right=5] (.2,.04);
                    \draw (-1.1,-.8) circle(.4);
                    \draw (-1,-.8) circle(.1);
                        \draw[xshift=-.7cm,yshift=-2cm] (.15,0) to[bend left=5] (-.5,.2) to[bend right=5] (.15,-.15);
                \end{scope}
        \fill[fill=white,scale=1.2,yshift=-6.3cm,xshift=-2cm,rounded corners] (0,0) -- (1.5,0) to[bend right=10] (1.4,.6) to[bend right=10] (0,.4) -- cycle;
        \begin{scope}
            \clip[draw] [scale=1.2,yshift=-6.3cm,xshift=-2cm,rounded corners] (0,0) -- (1.5,0) to[bend right=10] (1.4,.6) to[bend right=10] (0,.4) -- cycle;
                \draw[scale=1.2,yshift=-6.3cm,xshift=-2.1cm,rounded corners] (.4,0) to[bend left=10] (.4,.3);
                \draw[scale=1.2,yshift=-6.3cm,xshift=-1.9cm,rounded corners] (.4,0) to[bend left=10] (.4,.3);
        \end{scope}
        \begin{scope}
            \draw[xscale=-1,fill=white,scale=1.2,yshift=-6.3cm,xshift=-1cm,rounded corners] (0,0) -- (1.5,0) to[bend right=10] (1.4,.6) to[bend right=10] (0,.4) -- cycle;
                \draw[xscale=-1,scale=1.2,yshift=-6.3cm,xshift=-1.1cm,rounded corners] (.4,0) to[bend left=10] (.4,.3);
                \draw[xscale=-1,scale=1.2,yshift=-6.3cm,xshift=-.9cm,rounded corners] (.4,0) to[bend left=10] (.4,.3);
        \end{scope}
        \begin{scope}[xshift=4.52cm,yshift=-2.77cm,scale=.3,rotate=15]
            \draw (0,0) .. controls (1,.5) and (1.5,-.5) .. (2,-.5);
                \draw[yscale=-1,yshift=1cm] (0,0) .. controls (1,.5) and (1.5,-.5) .. (2,-.5);
                \draw (0,.02) -- (0,-.4);
                \draw (0,-.7) -- (0,-1);
        \end{scope}
    \end{tikzpicture}
\end{document}

输出如下:

截屏

答案1

只是为了好玩。tikzkoalas.sty可以找到这里。也许将来它会成为官方软件包的一部分。

\documentclass[export,border=5pt,tikz]{standalone}
\usepackage{tikzkoalas}
\usetikzlibrary{decorations.text,calc,decorations.markings}
\newsavebox\Koala
\sbox\Koala{\tikz{
\begin{scope}[local bounding box=koala]
\koala
\end{scope}
\foreach \X in {135,120,...,45}
{\draw (koala.\X) -- ++ (\X:1);}
\shade[ball color=blue] ($(koala.45)+(45:1)$) to[bend right=35] ($(koala.135)+(135:1)$)
to[out=90,in=90,looseness=2] cycle;}}
\begin{document}
\foreach \n in {0,1,...,20}
{
    \begin{tikzpicture}
    \useasboundingbox (-7,-10) rectangle (8,8);
        \pgfmathsetmacro{\w}{4*cos(\n r)*\n}
        \path[postaction=decorate,decoration={markings,mark=at position
        \n/20 with {\node[rotate={30*sin(\n*36)}]{\usebox\Koala};}}] plot[variable=\x,domain=0:720,samples=72] ({-1+1.5*sin(\x)},{4-\x/90});
    \begin{scope}[xshift=-.5*\n cm]
        \draw
        [line width=8mm,red,postaction={decorate,decoration={text along path,text
        align=center,text={|\large\color{white}\bfseries|TeX.SX rocks!!}}}] 
        plot[variable=\x,domain=0:360,samples=72] 
        ({4.8+\x/90},{6+0.2*cos(\x+\n*54)});
        \fill[yshift=6cm,rotate around={(45:(1,0))},rounded corners=.5cm] (0,0) rectangle (2,-4);

        \fill[xshift=-5cm,yshift=5cm,rounded corners=.5cm,black] (0,0) rectangle (10,2);
        \foreach \x in {0,1,...,8}
        {
            \fill[xshift=\x cm,white,xshift=-4.4cm,yshift=6.3cm,rounded corners=.1cm] (0,0) rectangle (.7,.5);
        }
        \draw[xshift=-3.5cm,yshift=5.05cm,line width=3pt] (0,0) --+ ([yshift=.1*\n cm]2,-.5);
        \draw[xshift=2.5cm,yshift=5.05cm,line width=3pt] (0,0) --+ ([yshift=.1*\n cm]-2,-.5);

    \end{scope}
    \end{tikzpicture}
}
\end{document}

在此处输入图片描述

相关内容