Difference between revisions of "File formats/3D Objects"
AngelHerraez (talk | contribs) (X3D in HTML5 and conversion) |
AngelHerraez (talk | contribs) (moving POV-Ray information to a new subpage) |
||
Line 1: | Line 1: | ||
{{File_Formats}} | {{File_Formats}} | ||
+ | = File Formats for 3D-world Objects Exported from Jmol = | ||
− | Recent versions of Jmol application and signed applet can export models to several formats that specify three-dimensional objects and can be read by specialized software | + | Recent versions of Jmol application and signed applet can export models to several formats that specify three-dimensional objects and can be read by specialized software (3D-world or 3D-scenes). |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== VRML == | == VRML == | ||
Line 148: | Line 141: | ||
* [http://www.collada.org General information about Collada]. | * [http://www.collada.org General information about Collada]. | ||
* [http://www.khronos.org/files/collada_spec_1_5.pdf#page=21 Format specification] (Collada schema). | * [http://www.khronos.org/files/collada_spec_1_5.pdf#page=21 Format specification] (Collada schema). | ||
+ | |||
+ | |||
+ | = See also = | ||
+ | [[File_formats/Ray_Tracing|File formats for ray tracing images]]. |
Revision as of 12:38, 6 February 2010
File Formats for 3D-world Objects Exported from Jmol
Recent versions of Jmol application and signed applet can export models to several formats that specify three-dimensional objects and can be read by specialized software (3D-world or 3D-scenes).
VRML
Jmol can export most features of the model into Virtual Reality Modeling Language, VRML version 2, also known as VRML97. This can be done from script or from the pop-up menu.
The vrml or wrl file can then be opened using several programs and browser plugins, and manipulated in 3D using the mouse.
Supported features
- Atoms (as spheres), bonds (as cylinders):
- including atom size, bond thickness, color, translucency
- double bonds (as parallel cylinders)
- Drawn objects (lines, arrows, triangles...).
- Isosurfaces (as IndexedFaceSets), even map-colored.
- Labels, 3D-positioned echo texts and measurement texts:
- text, color, font family and font style
- Trace (but slightly irregular if its diameter is very small)
- Ribbons and cartoons (using hermiteLevel 1 automatically if necessary).
- Dots, halos, stars, polyhedra, vectors, dipoles, ellipsoids
Unsupported features
- The orientation and zoom are not always kept.
- Labels, 3D-positioned echo texts and measurement texts:
- font size and offset are fixed (but they follow zoom in the VRML viewer)
- only 1st line is displayed, no multi-line texts
- alignment is always left
- no background labels
- Background image
- Ellipsoid quadrant cutouts
From Jmol to Blender
Blender is a free, open source, 3D content creation suite, available for all major operating systems under the GNU General Public License.
VRML files created by Jmol can be imported into Blender (v. 2.42 or later) using the VRML97-Import-Script. One dependency you might need is SimpleParse.
Optimizing VRML files
VRML files of medium to large molecules tend to be huge. Some ways to reduce their size:
- Run them through an optimizer program (see refs. below)
- Compress them using the
gzip
algorithm, and maybe rename to.wrz
which is the standard extension and should (hopefully) be recognized by viewers and browsers.
References
- The Annotated VRML 97 Reference, by Rikk Carey and Gavin Bell. Online documentation for the VRML format, including examples.
- A Guide to VRML 2.0 and an Evaluation of VRML Modelling Tools, by Neil Ashdown and Simon Forestiero. Online documentation for the VRML format.
- Chisel (HVRC Edition), a tool to optimize VRML files.
X3D
This is the Extensible 3D Graphics format, an XML successor of VRML.
Jmol (v.11.8) supports exporting to X3D. Features are nearly identical to those of VRML. (See VRML for details)
- Note:
- There are two X3D variants: one (
.x3d
) uses XML encoding, the other (.x3dv
) uses Classic VRML encoding. Jmol produces the former.
There is a move to integrate X3D into (X)HTML 5. This would allow future web browsers to display 3D content natively, without any plugins or applets.
References
- X3D for Web Authors, by Don Brutzman and Leonard Daly. Examples.
- X3DOM is an experimental open source framework and runtime to support the ongoing discussion in the Web3D and W3C communities how an integration of HTML5 and declarative 3D content could look like. It tries to fulfill the current HTML5 specification for declarative 3D content and allows including X3D elements as part of any HTML5 DOM tree.
- InstantLabs X3D encoding converter, an online converter from X3D or VRML97 to X3D or (X)HTML5.
Maya
Jmol can export, with limited features, the current view of a model into Maya ascii format. This can be done from script or from the pop-up menu. Wikipedia info on Maya
References
OBJ
Jmol (starting v. 11.7.28) can read files in the obj
file format. This format is generated by Wavefront, Java3D and PyMOL. The described objects are handled as isosurfaces in Jmol, so they can be saved in more compact JVXL format, if desired, and also can be mapped with other data.
- Description of
obj
file format at EG-Models.de, an archive of electronic geometry models. - Description of
obj
file format at FileFormat.info: www.fileformat.info/format/wavefrontobj/egff.htm - Description of
obj
file format at The Graphics File Formats Page by Martin Reddy. - Export of
obj
file format from PyMOL (molecular surfaces).
(Adobe's Portable Document Format)
Jmol can export an image of the model into a pdf document (single page, just the image in the center). Just use the methods for exporting images and choose pdf format in the drop-down list.
For producing pdf files with embedded 3D models, read about U3D below.
U3D
Universal 3D format. ECMA-363 Standard.
Not yet supported by Jmol (but see IDTF below).
The most interesting feature of this format is that it can be embedded in pdf files, providing a 3D experience inside this well established standard for publication.
There are, however, some problems in implementing this format in Jmol and so in successfully producing PDF files. The major limitations are related to the setting of a default view/orientation, or of alternative views, and of a rotation center. The documentation on the IDTF and U3D formats is unsatisfactory, and the stability of the 3D PDF standard is uncertain.
In summary, you can get a reasonably looking model inside a pdf document, but the user experience is much poorer than in Jmol app or applet.
References
- Universal 3D Sample Software project at SourceForge.
- A set of libraries to write, read, extend, render and interact with U3D-formatted data, as defined by standard ECMA-363. Intended as starting point for tools and applications to support U3D (exporters, importers, authoring packages and interactive viewers).
- MeshLab project at SourceForge.
- MeshLab is the first open source tool to provide direct conversion of 3D meshes into the U3D format. Now you can create pdf with 3D objects with just MeshLab and LaTeX.
- This page holds a demo that generates a 3D model in PDF from the molecule's PubChem CID. It also allows to download the result in PDF, U3D and IDTF formats.
IDTF
Jmol (11.8) can export to the Intermediate Data Text Format, a human-readable format that can be transformed into the binary U3D format and hence be later inserted into pdf files.
Conversion from IDTF to U3D can be done using a simple command-line utility, IDTFConverter:
- on Windows, it is available from Universal 3D Sample Software (see refs. below):
IDTFConverter.exe -input myMolecule.idtf -output myMolecule.u3d
- on MacOS and Linux, you can get a port of IDTFConverter (thanks to Michail Vidiassov) from http://www.iaas.msu.ru/tmp/u3d/u3d-1.2.852.tar.gz
Some potential future improvements:
- Bypass IDTF completely and go straight to U3D export from Jmol. The compression algorithm must be understood first.
- Embed the Jmol state script in the U3D file, so one can load the pdf file itself (
script "filename.pdf"
) or the U3D file itself (script "filename.u3d"
) back into Jmol. - Embed a CML source file in the script too, and we would be a step further down semantic publishing.
References
- Go to 'View All Files' and download the latest U3D_A_??.zip file. Within it, see Docs/IntermediateFormat/IDTF Format Description.pdf) and Bin/Win32/Release/IDTFConverter.exe.
- Alternatively, get just the necessary files from http://www.iaas.msu.ru/tmp/u3d/u3dIntelWin.zip
Collada
Collada formats (KMZ/DAE) are Open Source arrangements that have been incorporated into many 3D packages and support textures/surfaces etc. They are a possible XML replacement to VRML.
Not yet supported by Jmol. There is a feature request for this.
We would need:
- A description of how to specify a cylinder (position/translation, orientation/rotation, radius, length) but not using vertexes or meshes.
- A description of how to specify a sphere (position/translation, orientation/rotation, radius) but not using vertexes or meshes.
References
- General information about Collada.
- Format specification (Collada schema).
See also
Contributors
AngelHerraez, Michaelrandolph, NicolasVervelle, Kmcallenberg, Rzepa