I have a 3D plot I produced in Mathematica and I would like to share it with the world in a way that allows my audience to rotate it and interact with it in the broadest possible way. I would like this to be:
- In an open format that does not require a special player.
- Ideally something that can be opened directly in a browser or similarly common utility, and
- Something I can package in a single file, or set of files, without depending on a server.
The files could be distributed both directly to a contact, or as e.g. supplementary information to a journal article, uploaded on a web server. I would like to avoid solutions which depend on Wolfram servers or demand the viewer to have WRI software installed.
Solutions need not satisfy all of the above criteria, but they are all desirable:
- The entry barrier for the user should be as low as possible. Saying "here, click this and it will open" will result in a lot more views than will "so yeah, you need to download X plugin and have Y browser, and then go to Z and select 'save link', ...".
- If the plot is to be deployed as supplementary information for a journal article, it is important that the author be able to give the journal a self-contained implementation which the journal itself can host itself. For long-term durability reasons, it is desirable that this implementation doesn't have external dependencies on servers which may later move or go down.
- Similarly, being able to send a zip file to a contact and tell them "unzip it and open X file" without needing to upload files to a server widens the user base of people who can do the sending to those that don't have easy access to a web server.
- There are indeed technologies which lend themselves much more easily to non-proprietary deployment. However, it is desirable to be able to build the graphics in Mathematica without worrying about having to rebuild every part of the computation in an alternate system.
Meeting most of these requirements is definitely achievable. My favourite example is the manipulatable 3D graphics produced by NIST for the Digital Library of Mathematical Functions. These are amazingly simple to use and visualize and are well worth a look; for an example see their rendering of the gamma function:
NIST's implementation is a WebGL (a Javascript API for browsers which is widely supported) framework based on X3DOM and which implements the X3D standard; for more information see their documentation. While NIST explicitly refrains from endorsing the technology as a standard, it is a good sign that the standards are relatively mature and a good choice of technology.
I would like to replicate this type of behaviour. Is there some in-built or third-party functionality that allows it?
Ideally this thread should contain as many different approaches as possible - diversity is probably a good thing here.
three.js
- but with all those options it's hard to know what kind of answer you're really looking for. Too many options... maybe look intoprocessing.js
, it's easy to learn and can load 3D graphics. $\endgroup$