This page describes the text syntax of VRML 1.0 as the Web3D Consortium’s archived specification and the files on this machine show it. Where the explorer’s behaviour is described, it is the explorer’s, and says so.
Header line, comments and separators
The first line is #VRML V1.0 ascii; anything after it on that line is ignored, and the line ends at a
newline or carriage return. Anywhere else, # starts a comment that runs to the
end of the line (inside a string it is part of the string). Blanks, tabs, newlines and
carriage returns are white space and separate tokens; commas separate the values of a
multiple-value field. After the header a file holds exactly one node, which may be a
group node holding any number of others. The coordinate system is right-handed with +X
to the right and +Y up, lengths are in metres and angles in radians; by default objects
are projected along the +Z axis. Comments and white space need not be preserved: a
server may strip them, so persistent text belongs in an Info node.
Names and nodes
A node is its type name followed by braces holding its fields and, for group nodes,
its children: Separator { Material { diffuseColor 1 0 0 } Cube { } }. A field
is its name followed by a value. The specification says a node name must not begin with
a digit and must not contain spaces or control characters, single or double quotes,
backslashes, curly braces, the plus character or the period. DEF name
before a node gives it a name; USE name where a node is expected is the same
node again, not a copy. A node has at most one name, but names need not be unique: several
nodes may share one. (The explorer also refuses a few more characters, #,
commas, brackets, parentheses and |; the specification does not list
them.) Names are case sensitive.
Field types
| Type | Written as |
|---|---|
SFBool | TRUE or FALSE (also 0 and 1) |
SFColor, MFColor | three numbers from 0 to 1 for red, green and blue; a list is in brackets |
SFEnum | one bare word from the field’s list, such as PER_FACE |
SFBitMask | one or more bare words joined with | in parentheses, such as (SIDES | BOTTOM), or one word |
SFFloat, MFFloat | a number, or a list of them |
SFLong, MFLong | a 32-bit integer in decimal, hexadecimal (0x) or octal (leading 0), or a list; indices use -1 to end a face or line |
SFImage | width, height and number of components (1 to 4), then width × height pixel values in hexadecimal (0xFF0000) or decimal, each read as one unsigned number. Components run from the high byte: intensity then transparency for 2, red, green, blue for 3, and blue is followed by transparency for 4 (0x0000FF80 is semi-transparent blue). In VRML 1.0 a transparency of 1.0 is completely transparent (VRML97 uses opacity instead). Pixels run left to right, bottom to top |
SFMatrix | sixteen numbers, written row by row, for row vectors (translation in the last row) |
SFRotation | an axis (x y z) and an angle in radians |
SFString, MFString | ASCII text in double quotes (the quotes may be left out if there is no white space), or a list of them; any characters including newlines may be inside, and a double quote is written \" |
SFVec2f, MFVec2f | two numbers, or a list of pairs |
SFVec3f, MFVec3f | three numbers, or a list of triples |
A multiple-value field with one value may leave out the brackets. Numbers are decimal,
with an optional sign, fraction and exponent, or hexadecimal with 0x.
Traversal and state
A scene is drawn by walking the nodes in order, depth first, while keeping a state.
A property node changes the state for every node after it, until the end of the
enclosing Separator (or, for a TransformSeparator, until the
end of it for transformations only).
- Transformation nodes (
Transform,Translation,Rotation,Scale,MatrixTransform) multiply the current transform. Coordinate3,Normal,TextureCoordinate2set the vertex data that the next face, line or point set indexes.Material,MaterialBinding,NormalBinding,Texture2,Texture2Transform,ShapeHintsandFontStyleset the appearance.- Shape nodes draw with the state:
Cube,Sphere,Cone,Cylinder,IndexedFaceSet,IndexedLineSet,PointSet,AsciiText. Grouptraverses its children without saving anything.Switchtraverses the child numbered bywhichChild(−1 for none, −3 for all).LODchooses one child by the distance of the viewer.- The first camera (
PerspectiveCameraorOrthographicCamera) in the scene is the one the browser starts with.
Bindings
A Material may hold several values in each field. MaterialBinding says how they are spread over a shape; NormalBinding does the same for normals.
| Value | Meaning |
|---|---|
DEFAULT | the default for the shape (overall for materials) |
OVERALL | the first value for the whole shape |
PER_PART, PER_PART_INDEXED | one value for each part of a primitive (cylinder sides, top, bottom), in order or by materialIndex |
PER_FACE, PER_FACE_INDEXED | one value for each face or line, in order or by materialIndex |
PER_VERTEX, PER_VERTEX_INDEXED | one value for each vertex, in order or by materialIndex |
The explorer draws OVERALL, PER_FACE, PER_FACE_INDEXED, PER_VERTEX and PER_VERTEX_INDEXED for face sets from the diffuse colours, and ignores normals, ambient, specular and emissive colours and transparency.
Example
From a ray-tracing test scene exported by the VModel program (Illum2.wrl), which
draws two spheres in a room:
#VRML V1.0 ascii
#
#converted by VModel V0.60
Separator {
PerspectiveCamera {
position 1.270000 1.250000 3.000000
orientation 0.000000 1.000000 0.000000 2.670331
heightAngle 0.733038
}
Separator {
Info {
string "Stand"
}
Material {
diffuseColor 0.900000 0.600000 0.300000
Not described
What this page and the explorer leave out. All of it is defined by the published VRML 1.0 specification.
Known, not yet covered
- Reference: checked against the VRML 1.0 specification text (26 May 1995, martinreddy.net copy of the text; web3d.org also hosts it) on 2026-11-18 for the language basics, general syntax, coordinate system and field types. Not yet described: the specification’s instancing rules and its
fieldsandisAextensibility mechanism. How a browser picks a camera, the rules for normals and for part bindings, and thefieldsextension mechanism are not described. - Viewer: the text is read with these rules and the traversal follows transforms, Separator, Switch, Material and the bindings listed above; everything else in the state is ignored.