Introduction
VRML, the Virtual Reality Modeling Language, was the first standard for 3D scenes on
the web. A VRML file is called a world and is a text file, usually named
.wrl; a gzip-compressed world is often named .wrz. Two
versions are in use and they are different languages with the same extension:
VRML 1.0 (1995), derived from SGI’s Open Inventor, and VRML97 (VRML 2.0, 1996, ISO/IEC
14772), which added animation, sensors, sound and scripting. Neither can read the
other’s files. Browser plugins for VRML have long gone, and its successor is
X3D, whose classic encoding (.x3dv) has the
same text syntax as VRML97.
VRML is still written by CAD, scientific and 3D printing software as a simple way to
export coloured meshes. Some other programs use .wrl for unrelated text
formats (the raytracer scene files of an old course on this machine are one example):
a VRML world has the header line described below.
Variations
| Format | Variation | About | Open |
|---|---|---|---|
.WRL | VRML97 world | The first web 3D standard: a text tree of nodes, still used to export coloured meshes. | Open |
.WRL | VRML 1.0 world | The 1995 Open Inventor based VRML: a state machine of 36 nodes. | Open |
VRML 1.0
The first version. It is a scene description in the style of Open Inventor: a
state machine, in which nodes such as Material,
Coordinate3 and Translation set properties that the shapes
after them use, and Separator nodes save and restore that state. There
are 36 nodes and no events, scripts or prototypes.
The first line is #VRML V1.0 ascii. Children are written straight inside
the braces of a group, and enumerated values are bare words
(value PER_FACE, parts (SIDES | BOTTOM)).
VRML97
VRML 2.0, standardised as ISO/IEC 14772-1:1997. A scene graph of grouping nodes
(Transform, Group, Switch), Shape
nodes with an Appearance and a geometry, 54 nodes in all, with
PROTO and EXTERNPROTO to define new nodes, ROUTE
to send events from sensors and interpolators, and Script nodes with
JavaScript.
The first line is #VRML V2.0 utf8. Fields hold values of known types, so
a field’s value is always a number list, a string, TRUE or FALSE, or a node.
X3D classic encoding
Written .x3dv, with the first line #X3D V3.0 utf8 (or a
later 3.x). The syntax is VRML97’s with PROFILE, COMPONENT,
META, IMPORT and EXPORT statements and the far
larger X3D node set. The explorer reads it with the same reader.
Telling them apart
Read the first line. #VRML V1.0 ascii is VRML 1.0, #VRML V2.0
utf8 is VRML97 and #X3D V3.x utf8 is the X3D classic encoding. The
line is a comment, so a file without it can still be a world: a VRML97 file has no
other signature, and a reader decides by parsing. The explorer takes a
headerless .wrl as VRML97 only when it parses as one. A file that starts with
the bytes 1F 8B is gzip-compressed, and the gzip reader unpacks it.
Not described
What this reference and the explorer leave out. All of it is defined by published specifications (VRML 1.0, ISO/IEC 14772 VRML97, ISO/IEC 19776 X3D); nothing is known to be undocumented.
Known, not yet covered
- Reference: version details were written from memory and not checked against the VRML 1.0 and ISO/IEC 14772 specifications (see VRML 1.0 and VRML97).
- Reference: the X3D classic encoding (ISO/IEC 19776-2) is only outlined and the X3D node set is not described; see the X3D encodings page.
- Viewer: textures, lighting, transparency, Text, Inline worlds and animation are not drawn; shapes show their material colours only.
- Viewer: sensors, scripts and ROUTEs do nothing; they are listed, and Script source is shown as text.
- Viewer: files named by a world cannot be read from one dropped file.
- Viewer: gzip-compressed worlds (
.wrz) go to the gzip reader; that path was not tested. Only 5 real VRML files were available (2 VRML97 from three.js, 3 Live3D and VModel files).
Links
Software
- Castle Model Viewer – free viewer for VRML, X3D and other 3D formats (Windows, macOS, Linux)
- MeshLab – free open source mesh viewer and editor (Windows, macOS, Linux)
- Blender – free open source 3D suite that reads and writes VRML through its X3D add-on (Windows, macOS, Linux)
Developers
- X_ITE – X3D browser for web pages that also loads VRML (JavaScript)
Reference
- Web3D Consortium – the standards body that maintains VRML97 and X3D