0

How can I save a 3D graph as a gif image?

g = GraphPlot3D[{1 -> 2, 1 -> 3, 1 -> 4, 1 -> 5, 2 -> 3, 2 -> 4, 
    2 -> 5, 2 -> 6, 2 -> 7, 2 -> 8, 3 -> 6, 5 -> 6, 5 -> 7, 4 -> 7, 
    4 -> 8, 3 -> 8, 6 -> 9, 7 -> 9, 8 -> 9, 2 -> 9}, 
   EdgeRenderingFunction -> (Cylinder[#1, .05] &), 
   VertexRenderingFunction -> ({ColorData["Atoms"][
        RandomInteger[{1, 117}]], Sphere[#1, .15]} &), 
   PlotStyle -> Directive[Specularity[White, 20]], Boxed -> False];
center = Mean /@ (PlotRange /. AbsoluteOptions[g, PlotRange])
n1 = DynamicModule[{\[Theta]}, 
  DynamicWrapper[
   MapAt[GeometricTransformation[#, 
      RotationTransform[Dynamic[\[Theta]], {0, 0, 1}, center]] &, g, 
    1], \[Theta] = Clock[{0, 2 \[Pi], .01}, 10]]]

enter image description here

Emad kareem
  • 864
  • 1
  • 5
  • 13
  • 2
    maybe num = 20; table = Table[MapAt[GeometricTransformation[#, RotationTransform[t , {0, 0, 1}, center]] &, g, 1], {t , 0, 2 Pi, 2 Pi / num}]; Export["anim.gif", table]? – kglr Dec 20 '17 at 21:49
  • Linked topic should be enough to get this done but let me know if you disagree with marking it a duplicate. – Kuba Dec 21 '17 at 08:51

0 Answers0