Message Boards Message Boards

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

GROUPS:

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, π}]
 ]
POSTED BY: Clayton Shonkwiler
Answer
1 year ago

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: Moderation Team
Answer
1 year 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.
Answer
10 months ago

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 BY: Clayton Shonkwiler
Answer
10 months 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.
Answer
10 months ago

Group Abstract Group Abstract