I want to draw the three conic sections (circle, ellipse and rectangle) where the cylinder and cross sections are colored:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{animate}
\usepackage{filecontents}
\begin{document}
\begin{filecontents}{time2.txt}
::0x0
::1
::2
::3
\end{filecontents}
\begin{animateinline}[
begin={
\begin{tikzpicture}[line cap=round,line join=round,x=1.0cm,y=1.0cm,scale=0.6]
\clip(-3,0) rectangle (6,6);
},
end={\end{tikzpicture}},
controls,timeline=time2.txt]{1}
\draw [rotate around={0.:(1.5,1.)},line width=1.pt] (1.5,1.) ellipse (1.5897934007793624cm and 0.5267286371193529cm);
\draw [rotate around={0.:(1.5,5.)},line width=1.pt] (1.5,5.) ellipse (1.5897934007793588cm and 0.5267286371193518cm);
\draw [line width=1.pt] (-0.089793400779358,5.)-- (-0.089793400779362,1.);
\draw [line width=1.pt] (3.089793400779359,5.)-- (3.0897934007793624,1.);
\newframe %elipse
\draw [rotate around={-22.21759426951831:(1.5,3.14)},line width=1.pt,color=blue,fill=blue,fill opacity=0.2] (1.5,3.14) ellipse (1.6601578476760366cm and 0.6350780103265238cm);
\newframe %circunferencia
\draw [line width=1.pt] (3.089793400779359,5.)-- (3.0897934007793624,1.);
\draw [line width=1.pt,color=green,fill=green,fill opacity=0.2] (1.5,3) ellipse (1.57 and 0.6);
\newframe %rectangulo
\draw [line width=1.pt] (3.089793400779359,5.)-- (3.0897934007793624,1.);
\draw [line width=1.pt,color=orange,fill=orange,fill opacity=0.2](0.4,5.38) -- (0.39,1.38) -- (2.63,0.63) -- (2.62,4.63) -- cycle;
\end{animateinline}
\end{document}


tikz-3dplotinstead of theserotate aroundcommands. – Oct 30 '18 at 17:02