to X3D Resources

X3D Scene Authoring Hints

to Web3D home page

These hints provide a collection of style guidelines, authoring tips and best practices to improve the quality, consistency and maintainability of Extensible 3D (X3D) Graphics scenes.

Audio | Authoring | Color | containerField | Coordinate Systems, Rotations | Credits | Dates | Encodings | HTML | Images and Videos | Inlines and Prototypes | License | Meshes | meta Statements and Metadata Nodes | Motion Capture (MOCAP) | Naming Conventions | Scale Factors | Scripts (JavaJavaScriptJSON) | Strings | SVG | Tooltips | URL Links | Validation | Viewpoints and Navigation | Volumes | VRML | X3D-Edit | X3D for Web Authors | X3D Resources | Contact

Audio and Sound Tools to top

Authoring Practices to top

Color to top


containerField to top

Each containerField value is the field name from the X3D Specification that indicates a contained node's relationship to its parent node.

Addition of containerField values only occurs in the XML encoding of .x3d scenes. For example: <Transform><Shape containerField='children'/></Transform> indicates that the Shape node is one of the children of the Transform node.

The X3D XML Schema, X3D DTD and X3D Tooltips each define all default containerField values, which are optional and can be omitted for scene terseness.

Parent-child field disambiguation sometimes remains necessary nevertheless: a few nodes have more than one field that can accept the same node type. In those ambiguous cases, the child node must have a non-default containerField value. Specifically, care must be taken with the following non-default child fields.

Non-default containerField values

Quality Assurance (QA): the X3D Validator checks default and defined containerField values for logical correctness.

Coordinate Systems and Rotations to top

Credits to top

Dates to top

Encodings to top

HTML to top

HTML is the publishing language of the World Wide Web. HTML web pages can embed or launch X3D scenes.

Images and Videos to top

Inline Scenes and Prototype Templates to top

License to top

Meshes to top

meta Statements to top

Metadata Nodes to top

Motion Capture (MOCAP) to top

Motion capture (MOCAP) can be used for adding behaviors to Humanoid Animation (H-Anim) files).

BVH references

BVH tools

Naming Conventions to top

Naming of multiple similar autogenerated files: Concatenate the following name components as appropriate. Separate components by period characters, since underscores disappear as part of a url and since hyphens will break across a line.

General notes on naming conventions:

Scale Factors and Unit Conversions to top

Scripts to top

Strings: SFString/MFString Encodings to top

Strings describe text, typically for display in the Text node. SFString/MFString refers to single-field string values and multi-field string arrays, respectively.

The empty string "" represents a blank line in an MFString array.

Representation Specification Equivalent Value Example
Abstract Specification
(actual display value)
5.3.14 SFString and MFString One, Two, Three
He said, "Immel did it!"
XML encoding (.x3d) 5.3.14 SFString and MFString string='"One, Two, Three" "" "He said, \"Immel did it!\""'
or else various XML character-entity substitution alternatives such as

string='"One, Two, Three" "" "He said, \&quot;Immel did it!\&quot;"'

string="&quot;One, Two, Three&quot; &quot;&quot; "He said, \&quot;Immel did it!\&quot;&quot;"
Compressed Binary Encoding (CBE) 4.2.3 X3D canonical form string='"One, Two, Three" "" "He said, \"Immel did it!\""' .xml
ClassicVRML encoding (.x3dv) 5.15 SFString and MFString
and Grammar
string [ "One, Two, Three", "", "He said, \"Immel did it!\"" ] .x3dv
VRML97 (.wrl) 5.15 SFString and MFString
and Grammar
string [ "One, Two, Three", "", "He said, \"Immel did it!\"" ] .wrl
JSON encoding (.json) X3D to JSON Stylesheet Converter: JSON strings "@string": [ "One, Two, Three", "", "He said, \"Immel did it!\"" ] .json
Java Scene Access Interface (SAI) B.4.25 SFString, B.4.26 MFString new String [] {"One, Two, Three", "", "He said, \"Immel did it!\""}
X3DJSAIL (.java) SFStringObject, MFStringObject .setString(new String [] {"One, Two, Three", "", "He said, \"Immel did it!\""})
.setString(new MFStringObject(new String [] {"One, Two, Three", "", "He said, \"Immel did it!\""}))
.setString(new MFStringObject("\"One, Two, Three\" \"\" \"He said, \\\"Immel did it!\\\"\""))

Scalable Vector Graphics (SVG) to top

Scalable Vector Graphics (SVG) is a markup language for describing two-dimensional graphics applications and images, and a set of related graphics script interfaces. SVG is supported by all modern browsers for desktop and mobile systems. There are many SVG authoring tools, and export to SVG is supported by all major vector graphics authoring tools.

Use with X3D



URL Links to top

Validation of X3D Scenes using DTD and XML Schema to top

This section shows example declarations of DTD and Schema in X3D scenes.

One of the biggest benefits of the .x3d file encoding is XML validation. XML checks for well-formed documents, DTD validation and schema validation greatly improve quality assurance (QA) for X3D scenes. This approach exposes many possible errors and helps authors eliminate Garbage In Garbage Out (GIGO) problems. Useful links:

XML validation is defined by the Extensible Markup Language (XML) 1.0. A number of document variations are possible for X3D scenes. For example, encoding information is optional and may designate a variety of character sets. The X3D specifications are carefully designed to be fully compatible with XML requirements.

The following sections provide detailed information on the proper file syntax for X3D DTD and XML Schema headers in an .x3d scene. Each version matches the corresponding X3D version (3.0, 3.1, 3.2, and 3.3). Thanks to X3D stability, each version is backwards compatible. For example, the X3D v3.2 DTD and schema can validate X3D v3.2, v3.1, or v3.0 content, but not v3.3 content.

Viewpoints and Navigation to top

Viewpoints are typically the most important mechanism for an author to suggest scene navigation to a user. Recommended keyboard defaults are listed in Annex G Recommended navigation behaviours. In this way, new users interacting with an X3D scene can have a relatively consistent experience, regardless of which X3D player might be used.

Volume Tools and Volume Visualization to top

The X3D Graphics Volume Rendering component. describes how voxels and polygons can live together in harmony within a single scene.

Virtual Reality Modeling Language (VRML97) to top

The X3D Graphics ClassicVRML Encoding is a direct successor of the VRML97 International Standard. Thanks to the careful design of X3D, full backwards compatibility is available.

Converting a VRML scene (.wrl file) to an X3D ClassicVRML scene (.x3dv file):

Additional X3D Resources of interest:

Contact to top

Questions, suggestions, additions and comments about this X3D Scene Authoring Hints page are welcome. Please send them to Don Brutzman (brutzman at who maintains it.

These hints were collected while teaching X3D Graphics and writing X3D for Web Authors. Questions, suggestions, additions and comments are welcome.

Online at

Updated: 28 May 2017