Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- light[t_, p_, s_] := p + t {s, 1};
- eye = Import[
- "http://a2.twimg.com/profile_images/1124979238/Eye_RGB__1__\
- reasonably_small.jpg"];
- spark = Import["http://cdn3.staztic.com/logos/spark-10.png"];
- frame[t_] :=
- Show[
- Graphics[{
- Line[{{0, t}, {2, t}}],
- PointSize[Medium],
- Point[{{0, t}, {2, t}}],
- Red, Rectangle[{0.9, t - 0.1}, {1.1, t + 0.1}],
- Inset[eye, {4, t}, {Right, Center}, 0.5],
- Green,
- If[Abs[t - 2.5] < 0.1,
- Disk[{3.5, 2.5}, 0.1],
- Opacity[1]
- ],
- If[Abs[t - 4.5] < 0.1,
- Disk[{3.5, 4.5}, 0.1],
- Opacity[1]
- ],
- If[Abs[t - 1] < 0.1,
- {Inset[spark, {0, 1}, {Center, Center}, 0.5],
- Inset[spark, {2, 1}, {Center, Center}, 0.5]},
- Opacity[1]
- ]
- }, PlotRange -> {{-1, 4}, {-0.1, 6.1}}],
- ParametricPlot[{light[Min[T, 1], {1, 0}, 1],
- light[Min[T, 1], {1, 0}, -1]}, {T, -10^-3, t},
- PlotStyle -> Directive[Thick, Darker@Yellow]],
- If[t > 1,
- ParametricPlot[{light[Min[T - 1, 1.5], {2, 1}, 1],
- light[Min[T - 1, 3.5], {0, 1}, 1], light[T - 1, {2, 1}, -1],
- light[T - 1, {0, 1}, -1]}, {T, 1 - 10^-3, t},
- PlotStyle -> Directive[Thick, Darker@Blue]]
- , Graphics[]
- ]
- ];
- Manipulate[frame[t], {t, 0, 5}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement