summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-geo/examples/Animate1.tex
blob: 4928b4c21142074ad4cd5e1dadfd3391c6481dc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
\documentclass[a4paper]{article}
\usepackage{pstricks-add,pst-geo}
\usepackage{animate}

\makeatletter
\newdimen\pssizeStar
\def\psset@sizeStar#1{\pssetlength\pssizeStar{#1}}
\psset@sizeStar{1.5pt}
%% adapté de \psRandom du package pstricks-add
%% pour rendre aléatoire la taille des étoiles
\def\psRandomStar{\pst@object{psRandomStar}}%
\def\psRandomStar@i{\@ifnextchar({\psRandomStar@ii}{\psRandomStar@iii(0,0)(1,1)}}
\def\psRandomStar@ii(#1){\@ifnextchar({\psRandomStar@iii(#1)}{\psRandomStar@iii(0,0)(#1)}}
\def\psRandomStar@iii(#1)(#2)#3{%
	\def\pst@tempA{#3}%
	\ifx\pst@tempA\pst@empty\psclip{\psframe(#2)}\else\psclip{#3}\fi
	\pst@getcoor{#1}\pst@tempA
	\pst@getcoor{#2}\pst@tempB
	\begin@SpecialObj
	\addto@pscode{
		\pst@tempA\space /yMin exch def
		/xMin exch def
		\pst@tempB\space /yMax exch def
		/xMax exch def
		/dy yMax yMin sub def
		/dx xMax xMin sub def
		rrand srand                 % initializes the random generator
		/getRandReal { rand 2147483647 div } def
		\psk@randomPoints {
			/DS \pst@number\pssizeStar\space getRandReal mul def
			\@nameuse{psds@\psk@dotstyle}
			\ifPst@color getRandReal 1 1 sethsbcolor \fi
			getRandReal dx mul xMin add
			getRandReal dy mul yMin add
			Dot
			\ifx\psk@fillstyle\psfs@solid fill \fi stroke
		} repeat
	}%
	\end@SpecialObj
	\endpsclip
	\ignorespaces
}
\makeatother
\definecolor{BlueDark}{cmyk}{1,1,0,0.5}
\newpsstyle{Globe}{circles=true,gridmap=true,daynight=false}
\newpsstyle{night}{fillstyle=solid,fillcolor=BlueDark,linecolor=BlueDark,opacity=0.8}
\pagestyle{empty}
\begin{document}

\begin{animateinline}[controls,autoplay,loop,
  begin={\psset{path=../data,Radius=5,Decran=100,Dobs=100,unit=0.5}\begin{pspicture}(-7,-7)(7,7)},
  end={\end{pspicture}}]{8}
%		% Generate frames for -2 ... 2
  \multiframe{12}{i=0+2,ih=1+2}{%
    \psframe*[linecolor=BlueDark](-7,-7)(7,7)%
    \psRandomStar[linecolor=yellow!50,randomPoints=100](-7,-7)(7,7){\psframe(-7,-7)(7,7)}
    \expandafter\ifodd\i
      \psGlobeTellure[hour=\i,Day=24,Month=12,Year=2016,borders,all](15.28,37.07){Syracuse}
    \else
      \psGlobeTellure[hour=\ih,Day=24,Month=12,Year=2016,borders,all](15.28,37.07){Syracuse}
    \fi
  }
\end{animateinline}


\bigskip
\begin{verbatim}
\definecolor{BlueDark}{cmyk}{1,1,0,0.5}
\newpsstyle{Globe}{circles=true,gridmap=true,daynight=false}
\newpsstyle{night}{fillstyle=solid,fillcolor=BlueDark,linecolor=BlueDark,opacity=0.8}
[...]
\begin{animateinline}[controls,autoplay,loop,
  begin={\psset{path=../data,Radius=5,Decran=100,Dobs=100,unit=0.5}%
         \begin{pspicture}(-7,-7)(7,7)},
  end={\end{pspicture}}]{8}
%		% Generate frames for -2 ... 2
  \multiframe{12}{i=0+2,ih=1+2}{%
    \psframe*[linecolor=BlueDark](-7,-7)(7,7)%
    \psRandomStar[linecolor=yellow!50,randomPoints=100]%
              (-7,-7)(7,7){\psframe(-7,-7)(7,7)}
    \expandafter\ifodd\i
      \psGlobeTellure[hour=\i,Day=24,Month=12,Year=2016,
            borders,all](15.28,37.07){Syracuse}
    \else
      \psGlobeTellure[hour=\ih,Day=24,Month=12,Year=2016,
            borders,all](15.28,37.07){Syracuse}
    \fi
  }
\end{animateinline}
\end{verbatim}

\end{document}