Mathematica Graphics with LiveGraphics3D

By Xah Lee. Date: . Last updated: .

LiveGraphics3D is a Java Applet that reads a text file of Mathematica graphics and allows the user to view and rotate it in real-time in a web browser. This page is a tutorial on how to use set up LiveGraphics3D to view Mathematica graphics.

LiveGraphics3D is written by Martin Kraus in around 1995. It's home page is at LiveGraphics3D. It is free for non-commercial use, and its home page has complete documentation.

Step by Step Instruction

First, you need to download the “live.jar” file at the LiveGraphics3D website. The “live.jar” is the engine that does the live rotation.

Then, you need a file of Mathematica graphics. Suppose this is your graphics file: mathematica_graphics.m. (if you are not familiar with Mathematica graphics see: Intro to Mathematica's 3D Graphics Format. )

Now, create a file “lg3d-test.html” with the following content:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>LiveGraphics3D Test</title>
</head>
<body>

<APPLET ARCHIVE="live.jar" CODE="Live.class" WIDTH="650" HEIGHT="650">
<PARAM NAME="INPUT_FILE" VALUE="mathematica_graphics.m">
</APPLET>

</body>
</html>

Now, you are all done. Open the lg3d-test.html file with a web browser, and you should see your graphics in live rotation.

Zip Compress Your File

Often, a Mathematica graphic contains thousands of polygons, resulting a large file. LiveGraphics3D also support reading in a zip compressed file, by using the INPUT_ARCHIVE applet parameter, like this:

<PARAM NAME="INPUT_ARCHIVE" VALUE="mathematica_graphics.m.zip">

Note that, the “INPUT_FILE” parameter still needs to be present. Its value should be the file name inside the zip archive.

Patreon me $5. Ask me question on patreon