- Center projection the lines to the sphere do this,but the difficult is how to dynamic draw the dashed lines,so the code need to be updated later.
Clear[pts,center,r];
pts = {{-12, -1, 4}, {-9, 14, 8}, {0, 9, 20}, {-3, -6, 16}};
center = {2, 4, 6};
r = 15;
Show[ParametricPlot3D[
Threaded@center +
r*Normalize /@ ({1 - s, s} . # & /@
Partition[pts - Threaded@center, 2, 1, 1]), {s, 0, 1}],
Graphics3D[Ball[center, r]], Boxed -> False, Axes -> False,
PlotRange -> All]

- Since the original gif product by the TeX package TikZ whose output format is pdf, here we also try to build several vector format pictures.
pts = {{-12, -1, 4}, {-9, 14, 8}, {0, 9, 20}, {-3, -6, 16}};
center = {2, 4, 6};
r = 15;
axis = {1, -1, 1} - {-1, 1, -1};
figs = Table[
Block[{rot = RotationMatrix[t, axis],
v = RotationMatrix[t, axis] . {1, 0, 0}, g1, g2, ball},
g1 = ParametricPlot3D[
Threaded@center +
r*Normalize /@ ({1 - s, s} . # & /@
Partition[pts - Threaded@center, 2, 1, 1]) //
Evaluate, {s, 0, 1},
PlotStyle -> Directive@{LightYellow, AbsoluteThickness[5]},
RegionFunction ->
Function[{x, y, z}, ({x, y, z} - center) . v > 0],
ViewProjection -> "Orthographic"];
g2 =
ParametricPlot3D[
Threaded@center +
r*Normalize /@ ({1 - s, s} . # & /@
Partition[pts - Threaded@center, 2, 1, 1]) //
Evaluate, {s, 0, 1},
PlotStyle ->
Directive@{Darker@Yellow, AbsoluteDashing[{1, 10}, 0, "Round"],
AbsoluteThickness[4]},
RegionFunction ->
Function[{x, y, z}, ({x, y, z} - center) . v < 0],
ViewProjection -> "Orthographic"];
ball =
Graphics[{RadialGradientFilling[{LightGray, Black}, {0.4, 0.7}],
Disk[Rest[center . rot], r]}];
g = Show[g1, g2, ViewProjection -> "Orthographic"];
Graphics[{ball[[1]],
g[[1]] /. {x_Real, y_Real, z_Real} -> Rest[{x, y, z} . rot]},
PlotRange -> All]], {t, 0, 2 π, .1}];
Export["test.gif", figs] // SystemOpen

Do[Export["test" <> ToString[i] <> ".pdf", figs[[i]]], {i, 1,
Length@figs}];
- By using the TeX package animate we make a pdf animation from previous pdf files.
\documentclass{article}
\usepackage{animate}
\usepackage{graphicx}
\begin{document}
\begin{center}
\animategraphics[controls,loop,width=4in]{5}{test}{1}{63}
\end{center}
\end{document}