Consider the following MWE:

%   \pgfmathsetseed{3}
    \foreach \n in {0,10,...,\random}
%   \foreach \n in {\random,...,\random}
            \useasboundingbox (-.5,-.75) rectangle (3.5,2.75);

                    \foreach \x in {1,...,3}
                    \foreach \y in {1,...,12}

                            \node[scale=.25,text=white,fill=red,minimum height=1.01cm,minimum width=1.01cm] at (\x,-\y) {\Huge\number};
                            \node[scale=.25,text=white,fill,minimum height=1.01cm,minimum width=1.01cm] at (\x,-\y) {\Huge\number};

                    \node[scale=.25,text=white,fill=red,minimum height=1.01cm,minimum width=3.01cm] at (2,0) {\Huge 0};



                        \draw[black,thick,fill=red] (\xpos,\ypos) circle(.2);
                        \draw[red,thick,fill=black] (\xpos,\ypos) circle(.2);
                        \draw[black,thick,fill=red] (1,0) circle(.2);

                    \foreach[count=\xx] \x in {0,20,...,340}
                        \fill[red] (\x:1) arc(\x:\x+10:1) -- (\x+10:.75) arc(\x+10:\x:.75) -- cycle;
                        \fill[rotate=10] (\x:1) arc(\x:\x+10:1) -- (\x+10:.75) arc(\x+10:\x:.75) -- cycle;
                            \draw[fill=white] (\x:1) arc(\x:\x+10:1) -- (\x+10:1.25) arc(\x+10:\x:1.25) -- cycle;
                            \draw[fill=white,rotate=10] (\x:1) arc(\x:\x+10:1) -- (\x+10:1.25) arc(\x+10:\x:1.25) -- cycle;
                            \node[red,rotate=\x,scale=.5] at (\x+5:1.1) {\nn};
                            \node[scale=.5,rotate=\x+15] at (\x+15:1.1) {\nnn};
                    \fill[ball color=white] (\n+5:{1-.05-(((1-2*.05)-.75)/2)}) circle(.05);

                    \fill[filz] (current bounding box.south west) rectangle (current bounding box.north east);


Here is the output:

enter image description here

I know, that the numbers are not in the right order and that there is one number missing, but it's not important. My question is:

How can I achieve, that the roulette slice is rotating clockwise, while the ball is rotating counter-clockwise to the slice and that the both stop rotating, when the ball falls into a cell. The rotating should be just like in real life, i.e. the rotation is at the beginning faster than at the end.

  • 3
    I guess that this is more a question on the conversion (unless you are looking for an inline animation). Here you can read how one can compile to mp4. Whether or not it is possible to automatically change the speed of an mp4, I do not know, but you could afford many slides such that the effect can be achieved, which is probably hard with gifs which become really huge.
    – user121799
    Dec 26, 2018 at 16:00

2 Answers 2


I followed a slightly different approach from @samcarter's and just assumed that the angular velocity decreases linearly from some maximal value vmax to zero. Then I integrated the angular velocity to get an angle. Sorry, I had to shorten your code a bit to produce a gif that can be uploaded. Unfortunately, I do not know how to upload mp4 files, which can be produced as described in this other answer by @samcarter.

\tikzset{declare function={tmax=100;
\foreach \Frame in {0,...,100}
\foreach \Y [evaluate=\Y as \X using {10*\Y+rot(\Frame)}] in {0,...,35}
\fill (\X-5:2.5) -- (\X-5:2) arc(\X-5:\X+5:2) -- (\X+5:2.5) arc(\X+5:\X-5:2.5);
\node[rotate=\X] at (\X:2.75){\Y};
\fill[red] (\X-5:2.5) -- (\X-5:2) arc(\X-5:\X+5:2) -- (\X+5:2.5) arc(\X+5:\X-5:2.5);
\node[rotate=\X,red] at (\X:2.75){\Y};
\draw (\X-5:2.5) -- (\X-5:3) arc(\X-5:\X+5:3) 
-- (\X+5:2.5) arc(\X+5:\X-5:2.5);
\shade[ball color=gray] ({-rot(\Frame)}:2.25) circle (1mm);

enter image description here


For the part of your question about the slowing down:

A simple solution would be to write a wrapper document that displays each page of your animation an increasing number of times.

For example if your animation creates 16 pages, the following document will show the first page one time, the second page two times etc. You could also use other functions, this linear function is just an example:


\setbeamertemplate{navigation symbols}{}

\setbeamercolor{background canvas}{bg=filz}


\foreach \n in {1,...,16}{

\foreach \x in {1,...,\insertframenumber}{



enter image description here

(sorry for the tiny image, the .gif would otherwise be too big to upload)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.