VRML97 defines 54 node types. Each is listed below as the specification gives it:
every field and event with its kind, type, name and default value, and the allowed
range after #, where (…) excludes and […] includes the end. In a file only
field and exposedField values are written; events are used by
ROUTE. Field types are explained on
Syntax and field types.
Grouping nodes
A bboxSize of −1 −1 −1 means no bounding box is given.
Transform applies, from the inside out, −center, scaleOrientation⁻¹,
scale, scaleOrientation, rotation, center, translation.
Anchor {
eventIn MFNode addChildren
eventIn MFNode removeChildren
exposedField MFNode children []
exposedField SFString description ""
exposedField MFString parameter []
exposedField MFString url []
field SFVec3f bboxCenter 0 0 0 # (-inf,inf)
field SFVec3f bboxSize -1 -1 -1 # (0,inf) or -1,-1,-1
}
Billboard {
eventIn MFNode addChildren
eventIn MFNode removeChildren
exposedField SFVec3f axisOfRotation 0 1 0 # (-inf,inf)
exposedField MFNode children []
field SFVec3f bboxCenter 0 0 0 # (-inf,inf)
field SFVec3f bboxSize -1 -1 -1 # (0,inf) or -1,-1,-1
}
Collision {
eventIn MFNode addChildren
eventIn MFNode removeChildren
exposedField MFNode children []
exposedField SFBool collide TRUE
field SFVec3f bboxCenter 0 0 0 # (-inf,inf)
field SFVec3f bboxSize -1 -1 -1 # (0,inf) or -1,-1,-1
field SFNode proxy NULL
eventOut SFTime collideTime
}
Group {
eventIn MFNode addChildren
eventIn MFNode removeChildren
exposedField MFNode children []
field SFVec3f bboxCenter 0 0 0 # (-inf,inf)
field SFVec3f bboxSize -1 -1 -1 # (0,inf) or -1,-1,-1
}
Inline {
exposedField MFString url []
field SFVec3f bboxCenter 0 0 0 # (-inf,inf)
field SFVec3f bboxSize -1 -1 -1 # (0,inf) or -1,-1,-1
}
LOD {
exposedField MFNode level []
field SFVec3f center 0 0 0 # (-inf,inf)
field MFFloat range [] # (0,inf)
}
Switch {
exposedField MFNode choice []
exposedField SFInt32 whichChoice -1 # [-1,inf)
}
Transform {
eventIn MFNode addChildren
eventIn MFNode removeChildren
exposedField SFVec3f center 0 0 0 # (-inf,inf)
exposedField MFNode children []
exposedField SFRotation rotation 0 0 1 0 # [-1,1],(-inf,inf)
exposedField SFVec3f scale 1 1 1 # (0,inf)
exposedField SFRotation scaleOrientation 0 0 1 0 # [-1,1],(-inf,inf)
exposedField SFVec3f translation 0 0 0 # (-inf,inf)
field SFVec3f bboxCenter 0 0 0 # (-inf,inf)
field SFVec3f bboxSize -1 -1 -1 # (0,inf) or -1,-1,-1
}
Shapes and appearance
Shape {
exposedField SFNode appearance NULL
exposedField SFNode geometry NULL
}
Appearance {
exposedField SFNode material NULL
exposedField SFNode texture NULL
exposedField SFNode textureTransform NULL
}
Material {
exposedField SFFloat ambientIntensity 0.2 # [0,1]
exposedField SFColor diffuseColor 0.8 0.8 0.8 # [0,1]
exposedField SFColor emissiveColor 0 0 0 # [0,1]
exposedField SFFloat shininess 0.2 # [0,1]
exposedField SFColor specularColor 0 0 0 # [0,1]
exposedField SFFloat transparency 0 # [0,1]
}
ImageTexture {
exposedField MFString url []
field SFBool repeatS TRUE
field SFBool repeatT TRUE
}
MovieTexture {
exposedField SFBool loop FALSE
exposedField SFFloat speed 1.0 # (-inf,inf)
exposedField SFTime startTime 0 # (-inf,inf)
exposedField SFTime stopTime 0 # (-inf,inf)
exposedField MFString url []
field SFBool repeatS TRUE
field SFBool repeatT TRUE
eventOut SFTime duration_changed
eventOut SFBool isActive
}
PixelTexture {
exposedField SFImage image 0 0 0
field SFBool repeatS TRUE
field SFBool repeatT TRUE
}
TextureTransform {
exposedField SFVec2f center 0 0 # (-inf,inf)
exposedField SFFloat rotation 0 # (-inf,inf)
exposedField SFVec2f scale 1 1 # (-inf,inf)
exposedField SFVec2f translation 0 0 # (-inf,inf)
}
Browsers must support JPEG and PNG for ImageTexture and MPEG-1 for
MovieTexture.
Geometry
In the index fields of IndexedFaceSet and IndexedLineSet,
−1 ends a face or polyline. ccw says whether faces are wound
anticlockwise seen from the front, solid whether back faces can be
skipped, and creaseAngle (radians) below which edges are smoothed.
Box {
field SFVec3f size 2 2 2 # (0,inf)
}
Cone {
field SFFloat bottomRadius 1 # (0,inf)
field SFFloat height 2 # (0,inf)
field SFBool side TRUE
field SFBool bottom TRUE
}
Cylinder {
field SFBool bottom TRUE
field SFFloat height 2 # (0,inf)
field SFFloat radius 1 # (0,inf)
field SFBool side TRUE
field SFBool top TRUE
}
Sphere {
field SFFloat radius 1 # (0,inf)
}
ElevationGrid {
eventIn MFFloat set_height
exposedField SFNode color NULL
exposedField SFNode normal NULL
exposedField SFNode texCoord NULL
field MFFloat height [] # (-inf,inf)
field SFBool ccw TRUE
field SFBool colorPerVertex TRUE
field SFFloat creaseAngle 0 # [0,inf)
field SFBool normalPerVertex TRUE
field SFBool solid TRUE
field SFInt32 xDimension 0 # [0,inf)
field SFFloat xSpacing 1.0 # (0,inf)
field SFInt32 zDimension 0 # [0,inf)
field SFFloat zSpacing 1.0 # (0,inf)
}
Extrusion {
eventIn MFVec2f set_crossSection
eventIn MFRotation set_orientation
eventIn MFVec2f set_scale
eventIn MFVec3f set_spine
field SFBool beginCap TRUE
field SFBool ccw TRUE
field SFBool convex TRUE
field SFFloat creaseAngle 0 # [0,inf)
field MFVec2f crossSection [ 1 1, 1 -1, -1 -1, -1 1, 1 1 ] # (-inf,inf)
field SFBool endCap TRUE
field MFRotation orientation 0 0 1 0 # [-1,1],(-inf,inf)
field MFVec2f scale 1 1 # (0,inf)
field SFBool solid TRUE
field MFVec3f spine [ 0 0 0, 0 1 0 ] # (-inf,inf)
}
IndexedFaceSet {
eventIn MFInt32 set_colorIndex
eventIn MFInt32 set_coordIndex
eventIn MFInt32 set_normalIndex
eventIn MFInt32 set_texCoordIndex
exposedField SFNode color NULL
exposedField SFNode coord NULL
exposedField SFNode normal NULL
exposedField SFNode texCoord NULL
field SFBool ccw TRUE
field MFInt32 colorIndex [] # [-1,inf)
field SFBool colorPerVertex TRUE
field SFBool convex TRUE
field MFInt32 coordIndex [] # [-1,inf)
field SFFloat creaseAngle 0 # [0,inf)
field MFInt32 normalIndex [] # [-1,inf)
field SFBool normalPerVertex TRUE
field SFBool solid TRUE
field MFInt32 texCoordIndex [] # [-1,inf)
}
IndexedLineSet {
eventIn MFInt32 set_colorIndex
eventIn MFInt32 set_coordIndex
exposedField SFNode color NULL
exposedField SFNode coord NULL
field MFInt32 colorIndex [] # [-1,inf)
field SFBool colorPerVertex TRUE
field MFInt32 coordIndex [] # [-1,inf)
}
PointSet {
exposedField SFNode color NULL
exposedField SFNode coord NULL
}
Text {
exposedField MFString string []
exposedField SFNode fontStyle NULL
exposedField MFFloat length [] # [0,inf)
exposedField SFFloat maxExtent 0.0 # [0,inf)
}
FontStyle {
field MFString family "SERIF"
field SFBool horizontal TRUE
field MFString justify "BEGIN"
field SFString language ""
field SFBool leftToRight TRUE
field SFFloat size 1.0 # (0,inf)
field SFFloat spacing 1.0 # [0,inf)
field SFString style "PLAIN"
field SFBool topToBottom TRUE
}
FontStyle values: family "SERIF",
"SANS" or "TYPEWRITER"; style
"PLAIN", "BOLD", "ITALIC" or
"BOLDITALIC"; justify "FIRST",
"BEGIN", "MIDDLE" or "END", for the major and
optionally the minor direction.
Geometric properties
Color {
exposedField MFColor color [] # [0,1]
}
Coordinate {
exposedField MFVec3f point [] # (-inf,inf)
}
Normal {
exposedField MFVec3f vector [] # (-inf,inf)
}
TextureCoordinate {
exposedField MFVec2f point [] # (-inf,inf)
}
Interpolators
Each maps a fraction (usually from a TimeSensor) through
key and keyValue to an output, linearly.
ColorInterpolator {
eventIn SFFloat set_fraction # (-inf,inf)
exposedField MFFloat key [] # (-inf,inf)
exposedField MFColor keyValue [] # [0,1]
eventOut SFColor value_changed
}
CoordinateInterpolator {
eventIn SFFloat set_fraction # (-inf,inf)
exposedField MFFloat key [] # (-inf,inf)
exposedField MFVec3f keyValue [] # (-inf,inf)
eventOut MFVec3f value_changed
}
NormalInterpolator {
eventIn SFFloat set_fraction # (-inf,inf)
exposedField MFFloat key [] # (-inf,inf)
exposedField MFVec3f keyValue [] # (-inf,inf)
eventOut MFVec3f value_changed
}
OrientationInterpolator {
eventIn SFFloat set_fraction # (-inf,inf)
exposedField MFFloat key [] # (-inf,inf)
exposedField MFRotation keyValue [] # [-1,1],(-inf,inf)
eventOut SFRotation value_changed
}
PositionInterpolator {
eventIn SFFloat set_fraction # (-inf,inf)
exposedField MFFloat key [] # (-inf,inf)
exposedField MFVec3f keyValue [] # (-inf,inf)
eventOut SFVec3f value_changed
}
ScalarInterpolator {
eventIn SFFloat set_fraction # (-inf,inf)
exposedField MFFloat key [] # (-inf,inf)
exposedField MFFloat keyValue [] # (-inf,inf)
eventOut SFFloat value_changed
}
Sensors
CylinderSensor {
exposedField SFBool autoOffset TRUE
exposedField SFFloat diskAngle 0.262 # (0,pi/2)
exposedField SFBool enabled TRUE
exposedField SFFloat maxAngle -1 # [-2pi,2pi]
exposedField SFFloat minAngle 0 # [-2pi,2pi]
exposedField SFFloat offset 0 # (-inf,inf)
eventOut SFBool isActive
eventOut SFRotation rotation_changed
eventOut SFVec3f trackPoint_changed
}
PlaneSensor {
exposedField SFBool autoOffset TRUE
exposedField SFBool enabled TRUE
exposedField SFVec2f maxPosition -1 -1 # (-inf,inf)
exposedField SFVec2f minPosition 0 0 # (-inf,inf)
exposedField SFVec3f offset 0 0 0 # (-inf,inf)
eventOut SFBool isActive
eventOut SFVec3f trackPoint_changed
eventOut SFVec3f translation_changed
}
ProximitySensor {
exposedField SFVec3f center 0 0 0 # (-inf,inf)
exposedField SFVec3f size 0 0 0 # [0,inf)
exposedField SFBool enabled TRUE
eventOut SFBool isActive
eventOut SFVec3f position_changed
eventOut SFRotation orientation_changed
eventOut SFTime enterTime
eventOut SFTime exitTime
}
SphereSensor {
exposedField SFBool autoOffset TRUE
exposedField SFBool enabled TRUE
exposedField SFRotation offset 0 1 0 0 # [-1,1],(-inf,inf)
eventOut SFBool isActive
eventOut SFRotation rotation_changed
eventOut SFVec3f trackPoint_changed
}
TimeSensor {
exposedField SFTime cycleInterval 1 # (0,inf)
exposedField SFBool enabled TRUE
exposedField SFBool loop FALSE
exposedField SFTime startTime 0 # (-inf,inf)
exposedField SFTime stopTime 0 # (-inf,inf)
eventOut SFTime cycleTime
eventOut SFFloat fraction_changed # [0,1]
eventOut SFBool isActive
eventOut SFTime time
}
TouchSensor {
exposedField SFBool enabled TRUE
eventOut SFVec3f hitNormal_changed
eventOut SFVec3f hitPoint_changed
eventOut SFVec2f hitTexCoord_changed
eventOut SFBool isActive
eventOut SFBool isOver
eventOut SFTime touchTime
}
VisibilitySensor {
exposedField SFVec3f center 0 0 0 # (-inf,inf)
exposedField SFBool enabled TRUE
exposedField SFVec3f size 0 0 0 # [0,inf)
eventOut SFTime enterTime
eventOut SFTime exitTime
eventOut SFBool isActive
}
Lights
DirectionalLight {
exposedField SFFloat ambientIntensity 0 # [0,1]
exposedField SFColor color 1 1 1 # [0,1]
exposedField SFVec3f direction 0 0 -1 # (-inf,inf)
exposedField SFFloat intensity 1 # [0,1]
exposedField SFBool on TRUE
}
PointLight {
exposedField SFFloat ambientIntensity 0 # [0,1]
exposedField SFVec3f attenuation 1 0 0 # [0,inf)
exposedField SFColor color 1 1 1 # [0,1]
exposedField SFFloat intensity 1 # [0,1]
exposedField SFVec3f location 0 0 0 # (-inf,inf)
exposedField SFBool on TRUE
exposedField SFFloat radius 100 # [0,inf)
}
SpotLight {
exposedField SFFloat ambientIntensity 0 # [0,1]
exposedField SFVec3f attenuation 1 0 0 # [0,inf)
exposedField SFFloat beamWidth 1.570796 # (0,pi/2]
exposedField SFColor color 1 1 1 # [0,1]
exposedField SFFloat cutOffAngle 0.785398 # (0,pi/2]
exposedField SFVec3f direction 0 0 -1 # (-inf,inf)
exposedField SFFloat intensity 1 # [0,1]
exposedField SFVec3f location 0 0 0 # (-inf,inf)
exposedField SFBool on TRUE
exposedField SFFloat radius 100 # [0,inf)
}
attenuation gives the constant, linear and quadratic terms of
1 ÷ max(a₁ + a₂r + a₃r², 1), where r is the distance from the light.
Bindable nodes
Only one of each of these is active at a time; sending TRUE to
set_bind makes a node the current one, and the first one in the file is
current at the start.
Background {
eventIn SFBool set_bind
exposedField MFFloat groundAngle [] # [0,pi/2]
exposedField MFColor groundColor [] # [0,1]
exposedField MFString backUrl []
exposedField MFString bottomUrl []
exposedField MFString frontUrl []
exposedField MFString leftUrl []
exposedField MFString rightUrl []
exposedField MFString topUrl []
exposedField MFFloat skyAngle [] # [0,pi]
exposedField MFColor skyColor 0 0 0 # [0,1]
eventOut SFBool isBound
}
Fog {
exposedField SFColor color 1 1 1 # [0,1]
exposedField SFString fogType "LINEAR"
exposedField SFFloat visibilityRange 0 # [0,inf)
eventIn SFBool set_bind
eventOut SFBool isBound
}
NavigationInfo {
eventIn SFBool set_bind
exposedField MFFloat avatarSize [ 0.25, 1.6, 0.75 ] # [0,inf)
exposedField SFBool headlight TRUE
exposedField SFFloat speed 1.0 # [0,inf)
exposedField MFString type [ "WALK", "ANY" ]
exposedField SFFloat visibilityLimit 0.0 # [0,inf)
eventOut SFBool isBound
}
Viewpoint {
eventIn SFBool set_bind
exposedField SFFloat fieldOfView 0.785398 # (0,pi)
exposedField SFBool jump TRUE
exposedField SFRotation orientation 0 0 1 0 # [-1,1],(-inf,inf)
exposedField SFVec3f position 0 0 10 # (-inf,inf)
field SFString description ""
eventOut SFTime bindTime
eventOut SFBool isBound
}
fogType is "LINEAR" or "EXPONENTIAL".
NavigationInfo type values are "WALK",
"EXAMINE", "FLY", "NONE" and
"ANY"; avatarSize is the collision distance, the eye
height and the tallest step the viewer can climb.
Sound
AudioClip {
exposedField SFString description ""
exposedField SFBool loop FALSE
exposedField SFFloat pitch 1.0 # (0,inf)
exposedField SFTime startTime 0 # (-inf,inf)
exposedField SFTime stopTime 0 # (-inf,inf)
exposedField MFString url []
eventOut SFTime duration_changed
eventOut SFBool isActive
}
Sound {
exposedField SFVec3f direction 0 0 1 # (-inf,inf)
exposedField SFFloat intensity 1 # [0,1]
exposedField SFVec3f location 0 0 0 # (-inf,inf)
exposedField SFFloat maxBack 10 # [0,inf)
exposedField SFFloat maxFront 10 # [0,inf)
exposedField SFFloat minBack 1 # [0,inf)
exposedField SFFloat minFront 1 # [0,inf)
exposedField SFFloat priority 0 # [0,1]
exposedField SFNode source NULL
field SFBool spatialize TRUE
}
Browsers must support uncompressed PCM WAV files for AudioClip, and
the specification recommends MIDI type 1 files as well.
Script and WorldInfo
Script {
exposedField MFString url []
field SFBool directOutput FALSE
field SFBool mustEvaluate FALSE
# and any number of:
eventIn eventType eventName
field fieldType fieldName initialValue
eventOut eventType eventName
}
WorldInfo {
field MFString info []
field SFString title ""
}
A Script’s url names its code, as a file or inline with a
protocol such as javascript:; the specification describes ECMAScript
and Java bindings.