我想得到一个漂亮的渐变,但我的渐变有点不连贯。也许你可以帮助我。更好的想法是:
(从上到下:光度、扩展速度、半径)
动画.tex
\documentclass[tikz]{standalone}
\usepackage{xcolor}
\begin{document}
\foreach \x in {60,62,...,100} %Color should change from white into a strong yellow
{
\begin{tikzpicture}[scale=.4]
\pgfmathsetmacro\Radius{(\x-1)/41+3}
\useasboundingbox[fill=black] (-10.2,-10.2) rectangle (10.2cm,10.2cm);
\fill[fill=yellow!\x] (0,0) circle (\Radius); %Here in the first frame should be the brightest color (white) and then change into a strong yellow
\end{tikzpicture}
}
\foreach \x in {100,98,...,60} %Color should change from strong yellow into a strong orange
{
\begin{tikzpicture}[scale=.4]
\pgfmathsetmacro\Radius{(\x-1)/41+3}
\useasboundingbox[fill=black] (-10.2,-10.2) rectangle (10.2cm,10.2cm);
\fill[fill=yellow!\x] (0,0) circle (\Radius);
\end{tikzpicture}
}
\foreach \x [count=\j] in {60,56,...,2} %Color should change into a light orange
{
\begin{tikzpicture}[scale=.4]
\pgfmathsetmacro\Radius{(\x-1)/41+3}
\useasboundingbox[fill=black] (-10.2,-10.2) rectangle (10.2cm,10.2cm);
\fill[fill=yellow!\x!orange] (0,0) circle (\Radius);
\end{tikzpicture}
}
\foreach \x in {2,6,...,60} %Color should change into white
{
\begin{tikzpicture}[scale=.4]
\pgfmathsetmacro\Radius{(\x-1)/41+3}
\useasboundingbox[fill=black] (-10.2,-10.2) rectangle (10.2cm,10.2cm);
\fill[fill=yellow!\x] (0,0) circle (\Radius);
\end{tikzpicture}
}
\end{document}
主文本
\documentclass[tikz]{beamer}
\usepackage{animate}
\begin{document}
\begin{frame}[fragile]
\begin{center}
\animategraphics[controls,loop]{30}{animation}{}{}
\end{center}
\end{frame}
\end{document}
答案1
这个怎么样?(我专注于图形,看到你找到了一种将动画纳入投影机的好方法。)
\documentclass[tikz]{standalone}
\usepackage{xcolor}
\begin{document}
\foreach \X in {0,2,...,358}
{\begin{tikzpicture}[scale=.4]
\pgfmathsetmacro\Radius{4-2*cos(\X+30)}
\useasboundingbox[fill=black] (-10.2,-10.2) rectangle (10.2cm,10.2cm);
\ifnum\X<91
\pgfmathtruncatemacro\OF{100*sin(\X)}
\colorlet{mixyo}{yellow!\OF!white}
\else
\ifnum\X<271
\pgfmathtruncatemacro\OF{50+50*sin(\X)}
\colorlet{mixyo}{yellow!\OF!orange}
\else
\pgfmathtruncatemacro\OF{-100*sin(\X)}
\colorlet{mixyo}{orange!\OF!white}
\fi
\fi
\fill[fill=mixyo] (0,0) circle (\Radius);
\end{tikzpicture}}
\end{document}