Group Abstract Group Abstract

Message Boards Message Boards

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

Rotating Roman surface

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, ?}]
 ]
4 Replies
Posted 10 years ago

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.

POSTED BY: J. M.

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?

Posted 10 years ago

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.

POSTED BY: J. M.

enter image description here - 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!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard