1
$\begingroup$

The enclosed code is a simplified version of the "Make Your Own Solar System" demonstration. How do I remove the manual Faster and Slower animation controls and add code for a permanent very slow speed of rotation? Thank you for your help.

Manipulate[Graphics3D[{Hue[.12], {Sphere[{0, 0, 0}, .1]},
   {FaceForm[], Sphere[{0, 0, 0}, .8 + .02]}, Gray,
   Table[Line[
     Table[{.8}[[i]] {Cos[ tt], Sin[ tt], 0}, {tt, 0, 2 Pi, 
       2 Pi/100.}]], {i, 1}],
   Blue, Sphere[.8 {Cos[ t], Sin[ t], 0}, .02]},
    PlotRange -> All, ImageSize -> {400, 400}, Boxed -> False, 
  SphericalRegion -> True, ViewAngle -> .340],
      "X1" -> {{t, 0, "time"}, 0, 100, ImageSize -> Small}]
$\endgroup$

2 Answers 2

6
$\begingroup$

The faster/slower controls can be controlled using AppearanceElements. The following values can be used in Manipulate:

"StepLeftButton", "StepRightButton", "PlayPauseButton", "FasterSlowerButtons", "DirectionButton"

Take the ones you want to use (you wanted to drop "FasterSlowerButtons"):

Manipulate[
 Graphics3D[{Hue[.12], {Sphere[{0, 0, 0}, .1]}, {FaceForm[], 
    Sphere[{0, 0, 0}, .8 + .02]}, Gray, 
   Table[Line[
     Table[{.8}[[i]] {Cos[tt], Sin[tt], 0}, {tt, 0, 2 Pi, 
       2 Pi/100.}]], {i, 1}], Blue, 
   Sphere[.8 {Cos[t], Sin[t], 0}, .02]}, PlotRange -> All, 
  ImageSize -> {400, 400}, Boxed -> False, SphericalRegion -> True, 
  ViewAngle -> .340], {{t, 0, "time"}, 0, 2 π, 
  AnimationRate -> .1, 
  AppearanceElements -> {"StepLeftButton", "StepRightButton", 
    "PlayPauseButton", "DirectionButton"}}]

Mathematica graphics

The speed can be set with AnimationRate, as mentioned in David's answer.

$\endgroup$
1
  • $\begingroup$ My thanks to both Sjoerd and David for their help. $\endgroup$ Commented Dec 30, 2014 at 1:55
4
$\begingroup$

Change the AnimationRate in the iterator:

Manipulate[ 
 Graphics3D[{Hue[.12], {Sphere[{0, 0, 0}, .1]}, {FaceForm[], 
    Sphere[{0, 0, 0}, .8 + .02]}, Gray, 
   Table[Line[
     Table[{.8}[[i]] {Cos[tt], Sin[tt], 0}, {tt, 0, 2 Pi, 
       2 Pi/100.}]], {i, 1}], Blue, 
   Sphere[.8 {Cos[t], Sin[t], 0}, .02]}, PlotRange -> All, 
  ImageSize -> {400, 400}, Boxed -> False, SphericalRegion -> True, 
  ViewAngle -> .340],
 {{t, 0, "time"}, 0, 2 \[Pi], AnimationRate -> .1, 
  ImageSize -> Small}]

Incidentally, for your repeated motion it is simplest to set the range (period) of your time variable to be 2 Pi.

$\endgroup$
1
  • 1
    $\begingroup$ A final suggestion to make your question and its answers more valuable to readers: Title your question in the most specific and valuable way. Your question really isn't about "rotation" (or even, more accurately "orbital rate") nor about "adding," but instead about controlling animation rate in a Manipulate environment. A more helpful title might be: "How to adjust the animation rate in a Manipulate environment" or something like that. Such a title would help those whose Manipulate environments render linear motion, changes in color or size, or indeed any dynamic effect. $\endgroup$ Commented Dec 30, 2014 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.