Message Boards Message Boards

GROUPS:

Help making a ball rotate around the origin in a gif

Posted 14 days ago
205 Views
|
4 Replies
|
4 Total Likes
|

Hello everyone! Could someone correct this command so that the ball rotates around the origin, when the .gif file is created??

Export["vectors9.gif", 
 Table[Graphics3D[{{Ball[{10 Cos[\[Theta]/10], 10 Sin[\[Theta]/10], 
       0}, 2]}, {Line[{{0, 0, 0}, {10 Cos[\[Theta]/10], 
        10 Sin[\[Theta]/10], 0}}]}, {Dashed, Blue, 
     Line[Table[
       10 {Cos[2 k Pi/99], Sin[2 k Pi/99], 0}, {k, 0, 100}]]}, {Red, 
     Arrow[Tube[{{0, 0, -2}, {0, 0, 2}}]]}}, ImageSize -> Small, 
   Boxed -> False], {\[Theta], 0, 20 \[Pi]}]]

I'll be very thankful.

4 Replies

(* This could help you *)

Export["vectors9.gif", Animate[Show[
   ParametricPlot3D[{10 Cos[t], 10 Sin[t], 0}, {t, 0, 2 Pi}, 
    PlotStyle -> {Dashed}, 
    PlotRange -> {{-13, 13}, {-13, 13}, {-2, 2}}],
   Graphics3D[{
     {Ball[{10 Cos[t], 10 Sin[t], 0}, 1]},
     {Line[{{0, 0, 0}, {10 Cos[t], 10 Sin[t], 0}}]},
     {Red, Arrow[Tube[{{0, 0, -2}, {0, 0, 2}}]]}
     }],
   Boxed -> False, Axes -> False], {t, 0, 2 Pi, .01}, 
  FrameMargins -> None]
 ]
Posted 14 days ago

It's great! Friend, I thank you for your help.

Posted 14 days ago

To avoid the jitter, specify the Graphics3D option PlotRange -> {{-12, 12}, {-12, 12}, {-2, 2}}.

enter image description here

Posted 14 days ago

Hello Friend! I'm grateful.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract