3

How I could transform animation on this torus :

 r = 2;
pl1 = ParametricPlot3D[{Cos[v] (r + Cos[u]), Sin[v] (r + Cos[u]), 
    Sin[u]}, {v, 0, 2 Pi}, {u, 0, 2 Pi}, Mesh -> False, 
   PlotStyle -> Opacity[0.7]];

pl2 = ParametricPlot3D[
   Block[{u = 3 t, v = 4 t}, {Cos[v] (r + Cos[u]), 
     Sin[v] (r + Cos[u]), Sin[u]}], {t, 0, 2 Pi}, PlotStyle -> Thick];

Animate[Show[pl1, pl2, 
  Graphics3D[{Green, 
    Sphere[Block[{u = 3 t0, v = 4 t0}, {Cos[v] (r + Cos[u]), 
       Sin[v] (r + Cos[u]), Sin[u]}], 0.1]}]], {t0, 0, 2 Pi}]

enter image description here

To animation based not on Point moving on the Curve, but curve wounding on the Torus, like there curve moving on surface : Surface

noname
  • 33
  • 2

2 Answers2

2
Animate[Show[pl1, 
     ParametricPlot3D[Block[{u = 3 t, v = 4 t}, {Cos[v] (r + Cos[u]), 
        Sin[v] (r + Cos[u]), Sin[u]}], {t, 0, t0}, PlotStyle -> Thick], 
  Graphics3D[{Green, Sphere[Block[{u = 3 t0, v = 4 t0}, {Cos[v] (r + Cos[u]), 
       Sin[v] (r + Cos[u]), Sin[u]}], 0.1]}]], {t0, 0, 2 Pi}]
kglr
  • 394,356
  • 18
  • 477
  • 896
2

Change 2 Pi in the PlotRange for the line with t0

Animate[Show[pl1, 
 ParametricPlot3D[Block[{u = 3 t, v = 4 t}, {Cos[v] (r + Cos[u]), 
 Sin[v] (r + Cos[u]), Sin[u]}], {t, 0, t0}, PlotStyle -> Thick],
 Graphics3D[{Green, Sphere[Block[{u = 3 t0, v = 4 t0}, {Cos[v] (r + Cos[u]), 
 Sin[v] (r + Cos[u]), Sin[u]}], 0.1]}]], {t0, 0, 2 Pi}]

enter image description here

Sumit
  • 15,912
  • 2
  • 31
  • 73