[GIF] Left or Right? (Rotating Roman surface)

rotating3L2r.gif

Left or Right?

A slightly unusual view of the Roman surface.

Source code:

DynamicModule[{cols},
 cols = RGBColor /@ {"#FFF4E1", "#E67A7A"};
 Manipulate[
  ParametricPlot3D[
   Evaluate@
    Table[{Cos[?] Sin[?] Sin[?], Cos[?] Sin[?] Cos[?], Cos[?]^2 Cos[?] Sin[?]}, 
      {?, 0, 2 ?, ?/50}], {?, 0, 2 ?}, PlotRange -> 1/2, 
   ViewPoint -> 5 {Cos[t], Sin[t], 0}, Boxed -> False, Axes -> False, 
   ImageSize -> 540, SphericalRegion -> True, Background -> cols[[2]],
    PlotStyle -> Directive[Thickness[.004], cols[[1]]]], {t, 0, ?}]
 ]
5 Likes

2015-11-02_10-07-11.png

  • another post of yours has been selected for the Staff Picks group, congratulations !

We are happy to see you at the top of the “Featured Contributor” board. Thank you for your wonderful contributions, and please keep them coming!

My take:

With[{cols = RGBColor /@ {"#FFF4E1", "#E67A7A"}},
     Manipulate[ParametricPlot3D[{Cos[?] Sin[?] Sin[?], Cos[?] Sin[?] Cos[?], Cos[?]^2 Cos[?] Sin[?]},
                                 {?, 0, 2 ?}, {?, 0, 2 ?}, Axes -> False, Background -> cols[[2]], Boxed -> False,
                                 ImageSize -> 540, Mesh -> 99, MeshFunctions -> {#4 &},
                                 MeshStyle -> Directive[Thickness[.004], cols[[1]]], PlotRange -> 1/2,
                                 PlotStyle -> None, SphericalRegion -> True, ViewPoint -> 5 {Cos[t], Sin[t], 0}],
                 {t, 0, ?}]]

Increase PlotPoints as needed.

Nice. I think I switched from meshes to individually-plotted curves because the mesh was not playing very nicely with the surface I originally had in this. Of course, when I got rid of the surface altogether, I should have gone back to the mesh, since it’s faster and conceptually simpler.

Incidentally, what’s the reason for using With rather than DynamicModule?

Since you aren’t dynamically changing cols in your Manipulate[] (which I’d say is really the only reason to use DynamicModule[]), simply injecting them with With[] suffices.