0
$\begingroup$

So imagine half a hollow sphere in a 3D parametric plot. I want to animate it from open to closed. Then have another half of a hollow sphere, with a slightly larger radius and the base of the circle rotated about 90 degrees, animate around the first one. So when the second sphere encloses the first one, it basically looks like a single eyelid closing, from one side to the other. When it's fully closed you just see the larger sphere and can't tell there is another inside.

It's apparently called a spherical double lock. After that, I need to make a triple lock, which needs 3 sphere shells.

How would I complete this?

Thanks in advance.

EDIT: Yes I have tried things similar- I tried using the examples from Wolfram's Reference site, particularly this example: SphericalPlot3D[{1, 2, 3}, {Theta, 0, Pi}, {Phi, 0, 3 Pi/2}]. It doesn't look how I want it and I can't get it to animate properly.

$\endgroup$
  • 4
    $\begingroup$ Have you tried anything? $\endgroup$ – Kuba Sep 24 '16 at 19:21
  • 3
    $\begingroup$ I'm voting to close this question as off-topic because there is no well-posed question in this post; the OP is simply begging for somebody to act as a free coding service. $\endgroup$ – m_goldberg Sep 25 '16 at 0:00
  • $\begingroup$ Yes I have tried things similar- I tried using the examples from Wolfram's Reference site, particularly this example: SphericalPlot3D[{1, 2, 3}, {[Theta], 0, Pi}, {[Phi], 0, 3 Pi/2}]. It doesn't look how I want it and I can't get it to animate properly. $\endgroup$ – naanman Sep 25 '16 at 5:09
3
$\begingroup$

Not hollow spheres, just simple spheres, but this should get you started:

red = RGBColor[0.94, 0.19, 0.15];
yellow = RGBColor[1., 0.9, 0.14];
green = RGBColor[0.5, 0.82, 0.19];
blue = RGBColor[0.19, 0.5, 0.85];
magenta = RGBColor[0.81, 0.31, 0.5];
brown = RGBColor[0.58, 0.37, 0.11];

r1 = 1.1;
r2 = 1.2;
r = Max[{r1, r2}];

Animate[
   Which[
      a <= 3 Pi,
         pplot1 = ParametricPlot3D[
            {Cos[u] Sin[v], Sin[u] Sin[v], Cos[v]},
            {v, Pi, 2 Pi}, {u, Pi, a},
            Mesh -> 5, BoundaryStyle -> Black,
            PlotStyle -> FaceForm[blue, green],
            Boxed -> False, Axes -> False,
            PlotRange -> {{-r, r}, {-r, r}, {-r, r}}
         ],
      a <= 4 Pi,
         Show[
            pplot2 = ParametricPlot3D[
               r1 {Sin[u] Sin[v], Cos[v], Cos[u] Sin[v]},
               {v, Pi, 2 Pi}, {u, 3 Pi/2, a - Pi/2},
               Mesh -> 5, BoundaryStyle -> Black,
               PlotStyle -> FaceForm[brown, magenta],
               Boxed -> False, Axes -> False,
               PlotRange -> {{-r, r}, {-r, r}, {-r, r}}
            ],
            pplot1
         ],
      True,
         Show[
            ParametricPlot3D[
               r2 {Cos[u] Sin[v], -Cos[v], Sin[u] Sin[v]},
               {v, Pi, a - 5 Pi/2}, {u, 0, 2 Pi},
               Mesh -> 5, BoundaryStyle -> Black,
               PlotStyle -> FaceForm[red, yellow],
               Boxed -> False, Axes -> False,
               PlotRange -> {{-r, r}, {-r, r}, {-r, r}}
            ],
            pplot2,
            pplot1
         ]
   ],
   {a, 2 Pi, 9 Pi/2}
]

enter image description here

$\endgroup$

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