4
$\begingroup$

Are there any export formats which preserve the ability to interact with 3D Graphics? (In particular, the ability to rotate.)

EDIT: I've found this question: How to make a 3D plot auto-rotate? which produces an object with head DynamicModule. Can I export as an animated gif or QuickTime movie?

$\endgroup$
5
  • 2
    $\begingroup$ I guess it depends on the software you would use to rotate it after the export. $\endgroup$
    – Öskå
    Aug 11, 2014 at 17:29
  • 1
    $\begingroup$ Save your notebook as a CDF file and download the free CDF player to view and rotate? wolfram.com/cdf-player $\endgroup$
    – Bill
    Aug 11, 2014 at 18:30
  • $\begingroup$ Take a look here. $\endgroup$
    – Öskå
    Aug 11, 2014 at 19:07
  • $\begingroup$ I don't think this is a duplicate since the OP specifically asks for an export format that "preserves the ability to interact with 3D Graphics" and then settles for a non-interactive animated gif/movie. I am not clear on what is being asked here. $\endgroup$ Aug 12, 2014 at 1:57
  • $\begingroup$ @stopple Why is the CDF format not desirable? All the other suggestions pale in comparison with what you can do with CDF. $\endgroup$
    – Edmund
    Jul 25, 2015 at 13:12

3 Answers 3

6
$\begingroup$

First let's take a 3D element:

g = PolyhedronData["Spikey"];

Mathematica graphics

  • Export as GIF:

    As stated here one can Export a List of images as a GIF:

    animation = Table[Show[g, Boxed -> False, 
      ViewVector -> {0, 5 Cos@u, 5 Sin@u}], {u, 0, Pi, Pi/20}];
    Export["~/animated.gif", animation, "DisplayDurations" -> .1]
    

    giving:

    enter image description here


But since the question is "Are there any export formats which preserve the ability to interact with 3D Graphics? (In particular, the ability to rotate.)" I propose the following which I find very interesting:

  • Export as STL:

    Export["~/Spikey.stl", g];
    

Then one can use Sketchfab to visualize it and get the ability to easily interact with it (click for the full ~3MB GIF):

enter image description here

$\endgroup$
5
  • $\begingroup$ Nice and interesting. +1 $\endgroup$
    – RunnyKine
    Aug 12, 2014 at 0:33
  • $\begingroup$ @RunnyKine Thank you, I felt that the Sketchfab idea was worth being shared :) $\endgroup$
    – Öskå
    Aug 12, 2014 at 0:35
  • $\begingroup$ Indeed, thanks for sharing :) $\endgroup$
    – RunnyKine
    Aug 12, 2014 at 0:36
  • $\begingroup$ How can I increase the distance in the animation, such that the whole graphic is shown? Have a similar problem and found this question. $\endgroup$ May 17, 2020 at 17:30
  • $\begingroup$ @HighwayJohn Have you looked at the "DisplayDurations" option? $\endgroup$
    – Öskå
    Jun 30, 2020 at 9:42
1
$\begingroup$

Partly a response, You can work with Interactive Manipulation (just hit F1 and search for it) as well with Import and Export Animations (you know F1).

m = Manipulate[Plot3D[Sin[x y + a], {x, 0, 6}, {y, 0, 6}], {a, 0, 4}]

Export["manipulate1.avi", %]

Works fine on Mac OS X x86 (64-bit) internals will translate "avi" to "mov".

enter image description here

$\endgroup$
1
$\begingroup$

Possibly you are looking for something like LiveGraphics3D, a Java applet for interactive rotation of 3D graphics. Three different summaries:

$\endgroup$
2
  • $\begingroup$ Cannot download applet from Mr Kraus' homepage. The Mathworld link does not seem to work with Safari 11.0.1 even if I allow the Java plugin everywhere: no animation is visible. :-( $\endgroup$ Jun 13, 2018 at 9:21
  • $\begingroup$ @LaryxDecidua I'm sorry to say that LiveGraphics3D appears to be an abandoned product. The Mathworld example isn't working for me either at this point, but I get a message that it is blocked so I should at least try to figure out how to unblock it. Nevertheless I don't think this will be of much use any more, even though it was once a nice solution. $\endgroup$
    – Mr.Wizard
    Jun 13, 2018 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.