Message Boards Message Boards

1
|
6629 Views
|
2 Replies
|
8 Total Likes
View groups...
Share
Share this post:

Get rid of a controller/variable in Animate?

Posted 6 years ago

Hello!

I'm trying to get rid of controllers and the controller variable using Animate. I've gotten rid of the controllers, but the variable ? still shows up.

animate[obj_] := Animate[
   With[
    {v = RotationTransform[\[Theta], {0, 0, 1}][{3, 0, 3}]},
    Show[obj, ViewPoint -> v]], {\[Theta], 0, 2 Pi},
   Alignment -> Center,
   Paneled -> False,
   SaveDefinitions -> True,
   AnimationRate -> .01,
   AppearanceElements -> None,
   AnimationRunning -> True] /.
  (AppearanceElements -> _) ->
   (AppearanceElements -> {})

Giving the following animation:

PRNP

If I use ControlType->None, ? does not show up...

animate2[obj_] := Animate[
   With[
    {v = RotationTransform[\[Theta], {0, 0, 1}][{3, 0, 3}]},
    Show[obj, ViewPoint -> v]], {\[Theta], 0, 2 Pi},
   Alignment -> Center,
   Paneled -> False,
   SaveDefinitions -> True,
   AnimationRate -> .01,
   AppearanceElements -> None,
   AnimationRunning -> True,
   ControlType -> None] /.
  (AppearanceElements -> _) ->
   (AppearanceElements -> {})

enter image description here

...but then it does not rotate. I realize it needs some sort of control object (or I'm guessing it does), but is there a way to hide ? so all I get is a rotating object that starts automatically upon code evaluation?

Any help is appreciated!

POSTED BY: Null Null
2 Replies

You can use Dynamic and Clock:

Dynamic@Graphics3D[Cuboid[], 
  ViewPoint -> RotationTransform[Clock[2 Pi], {0, 0, 1}][{3, 0, 3}]]
POSTED BY: Gianluca Gorni
Posted 6 years ago

It's kind of cheesy, but if this is purely for visualization purposes, have you considered making the label White or completely transparent?

animate[obj_] := 
 Animate[With[{v = RotationTransform[\[Theta], {0, 0, 1}][{3, 0, 3}]},
     Show[obj, ViewPoint -> v]], {\[Theta], 0, 2 Pi}, 
   Alignment -> Center, Paneled -> False, SaveDefinitions -> True, 
   AnimationRate -> .01, AppearanceElements -> {}, 
   AnimationRunning -> True, 
   LabelStyle -> Opacity[0]] /. 
   (AppearanceElements -> _) -> (AppearanceElements \
    -> {})

animate[Graphics3D[{Blue, Cylinder[]}]]

enter image description here

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

Group Abstract Group Abstract