I am rotating a triangle, I want only the first and last triangle of the last two frames to appear.
I want the triangles that are between the first and last triangle to be hidden.
Attached latex code.
\documentclass[12pt]{article}
\usepackage{animate}
\usepackage{graphicx}
\usepackage{pgf,tikz}
\usepackage{color}
\begin{filecontents}{time.txt}
::0x0
::1
::2
::3
\end{filecontents}
\begin{document}
\begin{center}
\begin{animateinline}[
begin={
\begin{tikzpicture}[line cap=round,line join=round,x=1.0cm,y=1.0cm]
\clip(-4.7,-3.7) rectangle (4.7,3.7);
},
end={\end{tikzpicture}},
controls,timeline=time.txt]{1}
\draw [color=gray] (-4.5,-3.2) grid (4.5,3.2);
\foreach \x in {-4,...,4}
\draw [very thick] (\x,0.1) -- (\x,-0.1) node[below] {\x};
\foreach \y in {-3,...,3}
\draw [very thick] (0.1,\y) -- (-0.1,\y) node[left] {\y};
\draw [<->, very thick] (-4.5,0) -- (4.5,0) node [below] {$x$};
\draw [<->, very thick] (0,-3.5) -- (0,3.5) node [right] {$y$};
\draw [line width=1.5pt] (0,1) -- (1,3) -- (3,1) -- cycle;
\newframe % GIRO 90°
\draw [color=blue,line width=1.5pt] (-1,0) -- (-3,1) -- (-1,3)-- cycle;
\draw[color=black] (3.,2.7) node[anchor=north west] {\colorbox{white}{$\alpha=90$}};
\draw [->,line width=1.5pt](0.5,0) arc (0:90:0.5cm);
\newframe % GIRO 180°
\draw [color=blue,line width=1.5pt] (0,-1) -- (-1,-3) -- (-3,-1)-- cycle;
\draw[color=black] (3.,2.7) node[anchor=north west] {\colorbox{white}{$\alpha=180$}};
\draw [->,line width=1.5pt](0.5,0) arc (0:180:0.5cm);
\newframe % GIRO 270°
\draw [color=blue, line width=1.5pt] (1,0) -- (3,-1) -- (1,-3)-- cycle;
\draw[color=black] (3.,2.7) node[anchor=north west] {\colorbox{white}{$\alpha=270$}};
\draw [->,line width=1.5pt](0.5,0) arc (0:270:0.5cm);
\newframe % GIRO 360°
\draw [color=blue,line width=1.5pt] (0,1) -- (1,3) -- (3,1)-- cycle;
\draw[color=black] (3.,2.7) node[anchor=north west] {\colorbox{white}{$\alpha=360$}};
\draw [->,line width=1.5pt](0.5,0) arc (0:360:0.5cm);
\end{animateinline}
\end{center}
\end{document}
{}
button while editing your question. (I did that here, but this is to explain what happened.) More importantly, your code does not compile for me because I do not have the filetime2.txt
. To hide some part, you can just put it into\begin{scope}[opacity=0] ... \end{scope}
.