This is an excerpt from the VRML 1.0 Specification, located at the VRML Repository.

The Virtual Reality Modeling Language

Quick Reference

| Node | General Syntax | Coordinate System | Elements | instancing | Fields | Nodes |

Elements

| Header | Coordinate System |
instancing , extensions
| USE | new TypesisA
Fields
| SFBitMask | SFBoolSFColor | MFColorSFEnum | SFFloatMFFloat | SFImageSFLong | MFLong | SFMatrixSFRotation | SFStringMFString | SFVec2fMFVec2f | SFVec3fMFVec3f |
Nodes (36 as of v 1)
ShapesProperties | Groups
Misc
version Syntax Example

Header TOP of page

1 #VRML V1.0 ascii
2

Coordinates(local,world,camera) TOP of page Elements

  X: right Y:up Z:toward viewer
distance in meters
angles in radians
direction 0 0 -1

instancing TOP of page Elements

USE nodename

extensions TOP of page Elements

newTypeName {fields[fieldtype fieldname,...]} Cube {fields [ SFFloat width, SFFloat height, SFFloat depth ]
width 10 height 4 depth 3}

isA TOP of page Elements

newTypeName
{fields[fieldtype fieldname,...]
isA["existingType"] fieldname fieldvalue}
ExtendedMaterial {
fields [ MFString isA, MFFloat indexOfRefraction,
MFColor diffuseColor, MFFloat transparency ]
isA [ "Material" ]
indexOfRefraction .34
diffuseColor .8 .54 1
}

Field TOP of page Elements

1 SFBitMask ( flag1 | flag2 | ... ) SFBitMask [(1,2,3)]
SFBool 0 | 1 | TRUE | FALSE SFBool 0
SFColor [R G B] SFColor [1 2 1]
MFColor   [R G B,R G B,...] MFColor[ 1.0 0. 0.0, 0 1 0, 0 0 1 ]
SFEnum SFmnemonicName SFEnum SFmnemonicName [ 1.0 0. 0.0, 0 1 0, 0 0 1 ]
SFFloat [ansiCfloat] SFFloat [ 3.1415926]
MFFloat [ansiCfloat,ansiCfloat,...] MFFloat [ 3.1415926, 12.5e-3, .0001 ]
SFImage
SFLong
MFLong
SFMatrix
SFRotation
SFString
MFString
SFVec2f
MFVec2f
SFVec3f
MFVec3f

Node TOP of page Elements

Shapes TOP of page Elements

AsciiText
Cone
Cube
Cylinder
IndexedFaceSet
IndexedLineSet
PointSet
Sphere

Properties TOP of page Elements

Coordinate3
FontStyle
Info
Material
MaterialBinding
Normal
NormalBinding
Texture2
Texture2Transform
TextureCoordinate2
ShapeHints
MatrixTransform
Rotation
Scale
Transform
Translation

Groups TOP of page Elements

Separator
Switch
WWWAnchor
LOD

Misc TOP of page Elements

OrthographicCamera
PerspectiveCamera
DirectionalLight
PointLight
SpotLight
WWWInline {
"theName" bboxsize 0 0 0 bboxcenter 0 0 0}
WWWInline {"test.wrl"}

Node:

A node has the following characteristics:

The syntax chosen to represent these pieces of information is straightforward:

DEF objectname objecttype { fields  children }

Only the object type and curly braces are required; nodes may or may not have a name, fields, and children.

Node names must not begin with a digit, and must not contain spaces or control characters, single or double quote characters, backslashes, curly braces, the plus character or the period character.

TOP

General Syntax

For easy identification of VRML files, every VRML file must begin with the characters:


#VRML V1.0 ascii

Any characters after these on the same line are ignored. The line is terminated by either the ASCII newline or carriage-return characters.

The '#' character begins a comment; all characters until the next newline or carriage return are ignored. The only exception to this is within string fields, where the '#' character will be part of the string.

Note: Comments and whitespace may not be preserved; in particular, a VRML document server may strip comments and extraneous whitespace from a VRML file before transmitting it. Info nodes should be used for persistent information like copyrights or author information. Info nodes could also be used for object descriptions.

Blanks, tabs, newlines and carriage returns are whitespace characters wherever they appear outside of string fields. One or more whitespace characters separates the syntactical entities in VRML files, where necessary.

After the required header, a VRML file contains exactly one VRML node. That node may of course be a group node, containing any number of other nodes.

TOP

Coordinate System

VRML uses a cartesian, right-handed, 3-dimensional coordinate system. By default, objects are projected onto a 2-dimensional device by projecting them in the direction of the positive Z axis, with the positive X axis to the right and the positive Y axis up. A camera or modeling transformation may be used to alter this default projection.

The standard unit for lengths and distances specified is meters. The standard unit for angles is radians.

TOP

Fields

There are two general classes of fields; fields that contain a single value (where a value may be a single number, a vector, or even an image), and fields that contain multiple values. Single-valued fields all have names that begin with "SF", multiple-valued fields have names that begin with "MF". Each field type defines the format for the values it writes.

Multiple-valued fields are written as a series of values separated by commas, all enclosed in square brackets. If the field has zero values then only the square brackets ("[]") are written. The last may optionally be followed by a comma. If the field has exactly one value, the brackets may be omitted and just the value written. For example, all of the following are valid for a multiple-valued field containing the single integer value 1:


1
[1,]
[ 1 ]

TOP


[Modified By] Tuesday, April 07, 1998 01:17 AM Eastern Daylight Time