Skip to main content
Commonmark migration
Source Link

Perhaps the following will work for you. Since I worked it out more by trial-and-error than by expertise, there may be unnecessary code that remains. Mainly what I did was the following:

  1. Computed the camera position before doing the export by a better method. Your computation of the camera position was the source of the oscillation.

  2. Eliminated many options, some of which caused problems and others which were simply redundant. I also added a few options the improve the look of graphics.

Δϕ = π 14.0/13.0;

p1 =
  Table[
    RegionPlot3D[
      x^2 + y^2 + (z - j)^2 < 0.5^2 && 
      (x - 0.4 Cos[j Δϕ]) Cos[j Δϕ] + (y - 0.4 Sin[j Δϕ]) Sin[j Δϕ] < 0, 
      {x, -0.5, 0.5}, {y, -0.5, 0.5}, {z, -0.5 + j, 0.5 + j},
      PlotStyle -> Blue,  Lighting -> "Neutral", Mesh -> None],
    {j, 0, 5}];

p2 =
  Graphics3D[{
    Black,
    Table[
      Arrow @ Tube[{{0.4 Cos[j Δϕ], 0.4 Sin[j Δϕ], j}, {Cos[j Δϕ], Sin[j Δϕ], j}}], 
      {j, 0, 5}]}];

vp = 
  Table[
    RotationTransform[θ, {0, 0, 1}, {0, 0, 0}][{0, -50, 3}], 
    {θ, N[2 π Subdivide[36]]}];

Export[
  FileNameJoin[{$HomeDirectory, "Desktop", "RotatingSpheres.gif"}],
  Show[p1, p2,
    PlotRange -> {{-1, 1}, {-1, 1}, {-.5, 5.5}},
    Axes -> False,
    Boxed -> False,
    BoxRatios -> Automatic,
    SphericalRegion -> True,
    ViewPoint -> #] & /@ vp];

gif

###Update

Update

At Yves Klett's behest, I have made the arrows into 3D tube-based arrows.

Perhaps the following will work for you. Since I worked it out more by trial-and-error than by expertise, there may be unnecessary code that remains. Mainly what I did was the following:

  1. Computed the camera position before doing the export by a better method. Your computation of the camera position was the source of the oscillation.

  2. Eliminated many options, some of which caused problems and others which were simply redundant. I also added a few options the improve the look of graphics.

Δϕ = π 14.0/13.0;

p1 =
  Table[
    RegionPlot3D[
      x^2 + y^2 + (z - j)^2 < 0.5^2 && 
      (x - 0.4 Cos[j Δϕ]) Cos[j Δϕ] + (y - 0.4 Sin[j Δϕ]) Sin[j Δϕ] < 0, 
      {x, -0.5, 0.5}, {y, -0.5, 0.5}, {z, -0.5 + j, 0.5 + j},
      PlotStyle -> Blue,  Lighting -> "Neutral", Mesh -> None],
    {j, 0, 5}];

p2 =
  Graphics3D[{
    Black,
    Table[
      Arrow @ Tube[{{0.4 Cos[j Δϕ], 0.4 Sin[j Δϕ], j}, {Cos[j Δϕ], Sin[j Δϕ], j}}], 
      {j, 0, 5}]}];

vp = 
  Table[
    RotationTransform[θ, {0, 0, 1}, {0, 0, 0}][{0, -50, 3}], 
    {θ, N[2 π Subdivide[36]]}];

Export[
  FileNameJoin[{$HomeDirectory, "Desktop", "RotatingSpheres.gif"}],
  Show[p1, p2,
    PlotRange -> {{-1, 1}, {-1, 1}, {-.5, 5.5}},
    Axes -> False,
    Boxed -> False,
    BoxRatios -> Automatic,
    SphericalRegion -> True,
    ViewPoint -> #] & /@ vp];

gif

###Update

At Yves Klett's behest, I have made the arrows into 3D tube-based arrows.

Perhaps the following will work for you. Since I worked it out more by trial-and-error than by expertise, there may be unnecessary code that remains. Mainly what I did was the following:

  1. Computed the camera position before doing the export by a better method. Your computation of the camera position was the source of the oscillation.

  2. Eliminated many options, some of which caused problems and others which were simply redundant. I also added a few options the improve the look of graphics.

Δϕ = π 14.0/13.0;

p1 =
  Table[
    RegionPlot3D[
      x^2 + y^2 + (z - j)^2 < 0.5^2 && 
      (x - 0.4 Cos[j Δϕ]) Cos[j Δϕ] + (y - 0.4 Sin[j Δϕ]) Sin[j Δϕ] < 0, 
      {x, -0.5, 0.5}, {y, -0.5, 0.5}, {z, -0.5 + j, 0.5 + j},
      PlotStyle -> Blue,  Lighting -> "Neutral", Mesh -> None],
    {j, 0, 5}];

p2 =
  Graphics3D[{
    Black,
    Table[
      Arrow @ Tube[{{0.4 Cos[j Δϕ], 0.4 Sin[j Δϕ], j}, {Cos[j Δϕ], Sin[j Δϕ], j}}], 
      {j, 0, 5}]}];

vp = 
  Table[
    RotationTransform[θ, {0, 0, 1}, {0, 0, 0}][{0, -50, 3}], 
    {θ, N[2 π Subdivide[36]]}];

Export[
  FileNameJoin[{$HomeDirectory, "Desktop", "RotatingSpheres.gif"}],
  Show[p1, p2,
    PlotRange -> {{-1, 1}, {-1, 1}, {-.5, 5.5}},
    Axes -> False,
    Boxed -> False,
    BoxRatios -> Automatic,
    SphericalRegion -> True,
    ViewPoint -> #] & /@ vp];

gif

Update

At Yves Klett's behest, I have made the arrows into 3D tube-based arrows.

Added further explanation
Source Link
m_goldberg
  • 108.2k
  • 16
  • 104
  • 259

Perhaps the following will work for you. Since I worked it out more by trial-and-error than by expertise, there may be unnecessary code that remains. Mainly what I did was tothe following:

  1. computeComputed the camera position in advance ofbefore doing the export stepby a better method. Your computation of the camera position was the source of the oscillation.

  2. eliminateEliminated many options, some of which caused problems and others which were simply redundant. I also added a few options the improve the look of graphics.

Δϕ = π 14.0/13.0;

p1 =
  Table[
    RegionPlot3D[
      x^2 + y^2 + (z - j)^2 < 0.5^2 && 
      (x - 0.4 Cos[j Δϕ]) Cos[j Δϕ] + (y - 0.4 Sin[j Δϕ]) Sin[j Δϕ] < 0, 
      {x, -0.5, 0.5}, {y, -0.5, 0.5}, {z, -0.5 + j, 0.5 + j},
      PlotStyle -> Blue,  Lighting -> "Neutral", Mesh -> None],
    {j, 0, 5}];

p2 =
  Graphics3D[{
    Black,
    Table[
      Arrow @ Tube[{{0.4 Cos[j Δϕ], 0.4 Sin[j Δϕ], j}, {Cos[j Δϕ], Sin[j Δϕ], j}}], 
      {j, 0, 5}]}];

vp = 
  Table[
    RotationTransform[θ, {0, 0, 1}, {0, 0, 0}][{0, -50, 3}], 
    {θ, N[2 π Subdivide[36]]}];

Export[
  FileNameJoin[{$HomeDirectory, "Desktop", "RotatingSpheres.gif"}],
  Show[p1, p2,
    PlotRange -> {{-1, 1}, {-1, 1}, {-.5, 5.5}},
    Axes -> False,
    Boxed -> False,
    BoxRatios -> Automatic,
    SphericalRegion -> True,
    ViewPoint -> #] & /@ vp];

gif

###Update

At Yves Klett's behest, I have made the arrowarrows into 3D tube-based arrows.

Perhaps the following will work for you. Since I worked it out more by trial-and-error than by expertise, there may be unnecessary code that remains. Mainly what I did was to

  1. compute the camera position in advance of the export step

  2. eliminate many options, some of which caused problems and others which were simply redundant

Δϕ = π 14.0/13.0;

p1 =
  Table[
    RegionPlot3D[
      x^2 + y^2 + (z - j)^2 < 0.5^2 && 
      (x - 0.4 Cos[j Δϕ]) Cos[j Δϕ] + (y - 0.4 Sin[j Δϕ]) Sin[j Δϕ] < 0, 
      {x, -0.5, 0.5}, {y, -0.5, 0.5}, {z, -0.5 + j, 0.5 + j},
      PlotStyle -> Blue,  Lighting -> "Neutral", Mesh -> None],
    {j, 0, 5}];

p2 =
  Graphics3D[{
    Black,
    Table[
      Arrow @ Tube[{{0.4 Cos[j Δϕ], 0.4 Sin[j Δϕ], j}, {Cos[j Δϕ], Sin[j Δϕ], j}}], 
      {j, 0, 5}]}];

vp = 
  Table[
    RotationTransform[θ, {0, 0, 1}, {0, 0, 0}][{0, -50, 3}], 
    {θ, N[2 π Subdivide[36]]}];

Export[
  FileNameJoin[{$HomeDirectory, "Desktop", "RotatingSpheres.gif"}],
  Show[p1, p2,
    PlotRange -> {{-1, 1}, {-1, 1}, {-.5, 5.5}},
    Axes -> False,
    Boxed -> False,
    BoxRatios -> Automatic,
    SphericalRegion -> True,
    ViewPoint -> #] & /@ vp];

gif

###Update

At Yves Klett's behest, I have made the arrow into 3D tube-based arrows.

Perhaps the following will work for you. Since I worked it out more by trial-and-error than by expertise, there may be unnecessary code that remains. Mainly what I did was the following:

  1. Computed the camera position before doing the export by a better method. Your computation of the camera position was the source of the oscillation.

  2. Eliminated many options, some of which caused problems and others which were simply redundant. I also added a few options the improve the look of graphics.

Δϕ = π 14.0/13.0;

p1 =
  Table[
    RegionPlot3D[
      x^2 + y^2 + (z - j)^2 < 0.5^2 && 
      (x - 0.4 Cos[j Δϕ]) Cos[j Δϕ] + (y - 0.4 Sin[j Δϕ]) Sin[j Δϕ] < 0, 
      {x, -0.5, 0.5}, {y, -0.5, 0.5}, {z, -0.5 + j, 0.5 + j},
      PlotStyle -> Blue,  Lighting -> "Neutral", Mesh -> None],
    {j, 0, 5}];

p2 =
  Graphics3D[{
    Black,
    Table[
      Arrow @ Tube[{{0.4 Cos[j Δϕ], 0.4 Sin[j Δϕ], j}, {Cos[j Δϕ], Sin[j Δϕ], j}}], 
      {j, 0, 5}]}];

vp = 
  Table[
    RotationTransform[θ, {0, 0, 1}, {0, 0, 0}][{0, -50, 3}], 
    {θ, N[2 π Subdivide[36]]}];

Export[
  FileNameJoin[{$HomeDirectory, "Desktop", "RotatingSpheres.gif"}],
  Show[p1, p2,
    PlotRange -> {{-1, 1}, {-1, 1}, {-.5, 5.5}},
    Axes -> False,
    Boxed -> False,
    BoxRatios -> Automatic,
    SphericalRegion -> True,
    ViewPoint -> #] & /@ vp];

gif

###Update

At Yves Klett's behest, I have made the arrows into 3D tube-based arrows.

Improved arrows
Source Link
m_goldberg
  • 108.2k
  • 16
  • 104
  • 259

Perhaps the following will work for you. Since I worked it out more by trial-and-error than by expertise, there may be unnecessary code that remains. Mainly what I did was to

  1. compute the camera position in advance of the export step

  2. eliminate many options, some of which caused problems and others which were simply redundant

Δϕ = π 14.0/13.0;

p1 =
  Table[
    RegionPlot3D[
      x^2 + y^2 + (z - j)^2 < 0.5^2 && 
      (x - 0.4 Cos[j Δϕ]) Cos[j Δϕ] + (y - 0.4 Sin[j Δϕ]) Sin[j Δϕ] < 0, 
      {x, -0.5, 0.5}, {y, -0.5, 0.5}, {z, -0.5 + j, 0.5 + j},
      PlotStyle -> Blue,  Lighting -> "Neutral", Mesh -> None],
    {j, 0, 5}];

p2 =
  Graphics3D[{
    Black,
    Table[
     Arrow[ Arrow @ Tube[{{0.4 Cos[j Δϕ], 0.4 Sin[j Δϕ], j}, {Cos[j Δϕ], Sin[j Δϕ], j}}], 
      {j, 0, 5}]];]}];

vp = 
  Table[
    RotationTransform[θ, {0, 0, 1}, {0, 0, 0}][{0, -50, 3}], 
    {θ, N[2 π Subdivide[36]]}];

Export[
  FileNameJoin[{$HomeDirectory, "Desktop", "RotatingSpheres.gif"}],
  Show[p1, p2,
    PlotRange -> {{-1, 1}, {-1, 1}, {-.5, 5.5}},
    Axes -> False,
    Boxed -> False,
    BoxRatios -> Automatic,
    SphericalRegion -> True,
    ViewPoint -> #] & /@ vp];

gifgif

###Update

At Yves Klett's behest, I have made the arrow into 3D tube-based arrows.

Perhaps the following will work for you. Since I worked it out more by trial-and-error than by expertise, there may be unnecessary code that remains. Mainly what I did was to

  1. compute the camera position in advance of the export step

  2. eliminate many options, some of which caused problems and others which were simply redundant

Δϕ = π 14.0/13.0;

p1 =
  Table[
    RegionPlot3D[
      x^2 + y^2 + (z - j)^2 < 0.5^2 && 
      (x - 0.4 Cos[j Δϕ]) Cos[j Δϕ] + (y - 0.4 Sin[j Δϕ]) Sin[j Δϕ] < 0, 
      {x, -0.5, 0.5}, {y, -0.5, 0.5}, {z, -0.5 + j, 0.5 + j},
      PlotStyle -> Blue,  Lighting -> "Neutral", Mesh -> None],
    {j, 0, 5}];

p2 =
  Graphics3D[
   Table[
     Arrow[{{0.4 Cos[j Δϕ], 0.4 Sin[j Δϕ], j}, {Cos[j Δϕ], Sin[j Δϕ], j}}],
     {j, 0, 5}]];

vp = 
  Table[
    RotationTransform[θ, {0, 0, 1}, {0, 0, 0}][{0, -50, 3}], 
    {θ, N[2 π Subdivide[36]]}];

Export[
  FileNameJoin[{$HomeDirectory, "Desktop", "RotatingSpheres.gif"}],
  Show[p1, p2,
    PlotRange -> {{-1, 1}, {-1, 1}, {-.5, 5.5}},
    Axes -> False,
    Boxed -> False,
    BoxRatios -> Automatic,
    SphericalRegion -> True,
    ViewPoint -> #] & /@ vp];

gif

Perhaps the following will work for you. Since I worked it out more by trial-and-error than by expertise, there may be unnecessary code that remains. Mainly what I did was to

  1. compute the camera position in advance of the export step

  2. eliminate many options, some of which caused problems and others which were simply redundant

Δϕ = π 14.0/13.0;

p1 =
  Table[
    RegionPlot3D[
      x^2 + y^2 + (z - j)^2 < 0.5^2 && 
      (x - 0.4 Cos[j Δϕ]) Cos[j Δϕ] + (y - 0.4 Sin[j Δϕ]) Sin[j Δϕ] < 0, 
      {x, -0.5, 0.5}, {y, -0.5, 0.5}, {z, -0.5 + j, 0.5 + j},
      PlotStyle -> Blue,  Lighting -> "Neutral", Mesh -> None],
    {j, 0, 5}];

p2 =
  Graphics3D[{
    Black,
    Table[
      Arrow @ Tube[{{0.4 Cos[j Δϕ], 0.4 Sin[j Δϕ], j}, {Cos[j Δϕ], Sin[j Δϕ], j}}], 
      {j, 0, 5}]}];

vp = 
  Table[
    RotationTransform[θ, {0, 0, 1}, {0, 0, 0}][{0, -50, 3}], 
    {θ, N[2 π Subdivide[36]]}];

Export[
  FileNameJoin[{$HomeDirectory, "Desktop", "RotatingSpheres.gif"}],
  Show[p1, p2,
    PlotRange -> {{-1, 1}, {-1, 1}, {-.5, 5.5}},
    Axes -> False,
    Boxed -> False,
    BoxRatios -> Automatic,
    SphericalRegion -> True,
    ViewPoint -> #] & /@ vp];

gif

###Update

At Yves Klett's behest, I have made the arrow into 3D tube-based arrows.

deleted 6 characters in body
Source Link
m_goldberg
  • 108.2k
  • 16
  • 104
  • 259
Loading
Source Link
m_goldberg
  • 108.2k
  • 16
  • 104
  • 259
Loading