7
$\begingroup$

Could someone help me generate movement for this image

This image is like an impossible figure, yet I have seen similar ones but I can't imagine how to give it movement.

thanks in advance

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you very much, I searched the forum but didn't know how to ask, I tried the code that was on that page but it doesn't work for me. My version of MMA is 13.0.1.0 $\endgroup$
    – zeros
    Commented Jun 10 at 3:23

1 Answer 1

16
$\begingroup$

Edit

  • To get the original picture orientation,we can add π to θ.
f[s_, θ_] := 
  With[{R = 8, r = 4}, 
   R*{Cos[s], Sin[s], 0} + 
    r*{Cos[θ + π], Sin[θ + π], 
      Sin[θ - s]}];
δθ = 2 π/6;
δs = 2 π/16;
colors = {Yellow, LightYellow, Yellow, Gray, Brown, Gray, Yellow};
Manipulate[
 Graphics3D[
  Thread[{colors, 
    Table[Polygon[{f[s, θ], f[s, θ + δθ], 
       f[s + δs, θ + δθ], 
       f[s + δs, θ]}], {θ, 0 + t, 
      2 π + t, δθ}, {s, 0, 2 π, δs}]}], 
  ViewProjection -> "Orthographic", ViewPoint -> Bottom, 
  Boxed -> False, Lighting -> {{"Ambient", White}}], {t, 0, 2 π}]

enter image description here

Original

As I have mention in the comment, @LukasLang have provided an answer. Here we provide a simplified version.

Clear["Global`*"];
f[s_, θ_] = 
  With[{R = 8, r = 4}, 
   R*{Cos[s], Sin[s], 0} + 
    r*{Cos[θ], Sin[θ], Sin[θ - s]}];
δθ = 2   π/6;
δs = 2   π/16;
colors = ColorData[97] /@ Range[7];
Manipulate[
 Graphics3D[
  Thread[{colors, 
    Table[Polygon[{f[s, θ], f[s, θ + δθ], 
       f[s + δs, θ + δθ], 
       f[s + δs, θ]}], {θ, 0 + t, 
      2   π + t, δθ}, {s, 0, 
      2   π, δs}]}], ViewProjection -> "Orthographic", 
  ViewPoint -> Top, Boxed -> False, 
  Lighting -> {{"Ambient", White}}], {t, 0, 2  π}]

enter image description here

$\endgroup$
1
  • $\begingroup$ How do I place the same background and figure colors as that page? Thanks. also, the figure seems to open up $\endgroup$
    – zeros
    Commented Jun 10 at 3:37

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.