rmendelsohn
(Robert Mendelsohn)
April 27, 2025, 6:52pm
1
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]
Vitaliyk
(Vitaliy Kaurov)
April 27, 2025, 6:55pm
3
Probably simplest:
Tour3DVideo[MoleculePlot3D[Molecule["NC(=O)C[C@H](C(=O)O)N"],SphericalRegion->True]]
rmendelsohn
(Robert Mendelsohn)
April 27, 2025, 6:56pm
4
Perfect! I did not know about this function - always something new to explore in Wolfram Language. Thanks Vitaliy!