Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica animation animate

  1. Feb 12, 2010 #1
    Hi!

    Here is the code in Mathematica 7.

    Code (Text):

    sphere = RegionPlot3D[(x^2 + y^2 + z^2  <= 1) && (x < 0 || y < 0 ||
         z < 0), {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, Mesh -> False,
      Boxed -> False, Axes -> True, AxesOrigin -> {0, 0, 0},
      AxesLabel -> {X, y, Z}, PlotPoints -> 50,
      ColorFunctionScaling -> False,
      ColorFunction ->
       Function[{x, y, z}, ColorData["Rainbow"][1 - (x^2 + y^2 + z^2 )]],
      ViewPoint -> {1, 1, 1}, ViewVertical -> {1, 0, 0},
      ViewCenter -> {0, 0, 0}]


    Animate[Show[sphere, ViewVertical -> {Cos[v], Sin[v], 0},
      ViewCenter -> {1, 1, 1}], {v, 0, 2 Pi, Pi/20}]
     
    This plots a sphere with one of the quadrants cut out. I wish to animate this plot by rotating about the body diagonal of the bounding box. With the above Animate, I get te subsequent frames to jump around. How can that be fixed.

    Ultimately, I would like to make a movie clip out of it, what would be the best way to go about doing that.

    Thanks in advance.
    - N
     
  2. jcsd
  3. Feb 14, 2010 #2
    Solved!!! SphericalRegion->True does the job. I think I did try it set to true in the sphere before I posted here, but maybe I was messing things elsewhere.

    - N


    Code (Text):

    Animate[Show[sphere, Axes -> False, SphericalRegion -> True,
      ViewVertical -> {Sin[v], Cos[v], 0}], {v, 0, 2 Pi, Pi/36}]
     
     
  4. Feb 14, 2010 #3

    Dale

    Staff: Mentor

    Also, to make it smoother you can use the option:
    DisplayAllSteps -> True
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Mathematica animation animate
Loading...