Group Abstract Group Abstract

Message Boards Message Boards

3D rotate a MoleculePlot3D

Posted 1 day ago

I am really impressed by MoleculePlot3D, but I am wondering how to make the sort of classic "spinning molecule" GIF. The things I have tried ViewAngle and ViewCenter, but only succeed in a sort of fisheye look. I have used the following code (from documentation) as a template to no real success:

With[{obj = PolyhedronData["Icosahedron"]}, 
 Animate[Show[obj, SphericalRegion -> True, 
   ViewVector -> {5 Cos[t], 5 Sin[t], 10 Sin[t/2]}], {t, 0, 4 Pi}, 
  AnimationRunning -> False]]

Thank you for any help, I think this is a really cool area of the Wolfram Language! Forgive me if I am missing an obvious solution.

Robert,

maybe this is what you are trying to achieve:

videoList = 
  With[{obj = PolyhedronData["Icosahedron"]}, 
   Table[Show[obj, SphericalRegion -> True, ViewVector -> {5 Cos[t], 5 Sin[t], 5}], {t, 0, 2 Pi, .05}]];
Export["rotmol.gif", videoList, "DisplayDurations" -> .05]
POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard