I would like to do a Tikz image animation of growing lines with a certain randomness with regard to their initial rotation angle (and potentially also with a certain randomness in their initial x and y coordinates). I am aware that Tikz provides a rand and a random function (see example code) which work nicely for static images. However, inside of an animation they create a new random number for each frame. How could the random number be passed such that it is only evaluated initially?
\documentclass{standalone}
\usepackage{tikz}
\usepackage{animate}
\begin{document}
\begin{animateinline}[autoplay, loop]{24}
\multiframe{100}{ry=0.05+0.02}{
\begin{tikzpicture}
\foreach \x in {0,1,...,5}
{
\draw [thick, rotate around={random*10:(\x,0)}] ({\x},0) -- ++(0,\ry);
}
\path [use as bounding box] (0,0) rectangle (5,2.1);
\end{tikzpicture}}
\end{animateinline}
\end{document}
\pgfmathsetseed{<integer>}
: Explicitly sets the seed for the pseudo-random number generator (see pgf manual).