This tutorial is probably also available as a Jupyter notebook in the demo folder in the polymake source and on github.

Different versions of this tutorial: latest release, release 3.5, release 3.4, release 3.3, nightly master

Embed interactive visualizations in PDF files

With polymake and jReality you can even embed your visualizations as interactive applets into pdf files (from LaTeX).

  1. Visualize your polytope, or any other object, with jReality. You might need to call jreality($x->VISUAL); or something similar.
  2. Export the visualized object from jReality: File → Export → U3D
  3. In your tex-file you need to add the movie15 package and then use the \includemovie command to include the applet:
        \usepackage[3D]{movie15}
        ...
      	\includemovie[
	      mimetype=model/u3d,
	      3Djscript=Encompass.js,
              autoplay
	   ]
	{ \textwidth }
	{ 0.7\textwidth }
	{object.u3d}
  1. Compile the LaTeX source with pdflatex.
  2. View the pdf file with a reasonably recent version of Adobe Reader.

Options for includemovie

  • (More or less) optional arguments:
    • mimetype=model/u3d Mandatory to tell the viewer what kind of object this is.
    • autoplay Can be set to automatically load the applet when opening the page. Otherwise you will see a white area and a small text Click to activate.
    • 3Dscript JavaScript code to manipulate the scene (camera, lights, etc.).
  • Two arguments for the dimensions of the applet.
  • Filename.

Further information

  • An example PDF-file to test your PDF viewer. This also contains a non-polymake visualization created directly with jReality. (Try rotating the objects!)
  • A short tutorial in the jReality wiki, where you also find an example JavaScript file.
  • Documentation of the movie15 package.
  • user_guide/tutorials/pdf.txt
  • Last modified: 2019/01/29 21:46
  • (external edit)