Message Boards Message Boards

Help making a ball rotate around the origin in a gif

Posted 3 years ago

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.

POSTED BY: Jose Assuncao
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 BY: Mariano Gonzalez
Posted 3 years ago

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

enter image description here

POSTED BY: Rohit Namjoshi
Posted 3 years ago

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

POSTED BY: Jose Assuncao
Posted 3 years ago

Hello Friend! I'm grateful.

POSTED BY: Jose Assuncao
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