Every field of every X3D node has one of 42 types: 21 single-value types, whose names
start SF, each with a multiple-value MF form. X3D 4.0 (ISO/IEC
19775-1, clause 5) defines them; the list is the same in 3.x. In the XML encoding a
value is written as an attribute, in the ClassicVRML encoding after the field name;
an MF value in ClassicVRML is enclosed in square brackets, and the
default of every MF type is the empty list.
Types
| Type | Value | SF default | XML example |
|---|---|---|---|
SFBool, MFBool | true or false in XML, TRUE or FALSE in ClassicVRML | FALSE | solid="false" |
SFColor, MFColor | red, green, blue, each 0 to 1 | 0 0 0 | diffuseColor="0.8 0.2 0.2" |
SFColorRGBA, MFColorRGBA | red, green, blue, alpha, each 0 to 1 | 0 0 0 0 | color="1 0 0 1" |
SFDouble, MFDouble | a double-precision number | 0.0 | 3.141592653589793 |
SFFloat, MFFloat | a single-precision number | 0.0 | radius="0.5" |
SFImage, MFImage | width, height, number of components (1 to 4), then one integer per pixel, from the bottom left row by row | 0 0 0 | image="2 1 3 0xFF0000 0x00FF00" |
SFInt32, MFInt32 | a 32-bit integer, decimal or hexadecimal | 0 | coordIndex="0 1 2 -1" |
SFMatrix3d, MFMatrix3d | a 3×3 matrix of doubles, nine numbers | identity | |
SFMatrix3f, MFMatrix3f | a 3×3 matrix of floats | identity | |
SFMatrix4d, MFMatrix4d | a 4×4 matrix of doubles, sixteen numbers | identity | |
SFMatrix4f, MFMatrix4f | a 4×4 matrix of floats | identity | |
SFNode, MFNode | a node, written as a child element in XML | NULL | <Box/> |
SFRotation, MFRotation | an axis x, y, z and an angle in radians | 0 0 1 0 | rotation="0 1 0 1.5708" |
SFString, MFString | UTF-8 text; in an MFString each string is in double quotes, with \" and \\ as escapes | "" | url='"a.png" "b.png"' |
SFTime, MFTime | a double-precision number of seconds since 1 January 1970 GMT | −1 | startTime="0" |
SFVec2d, MFVec2d | two doubles | 0 0 | |
SFVec2f, MFVec2f | two floats | 0 0 | scale="1 1" |
SFVec3d, MFVec3d | three doubles | 0 0 0 | |
SFVec3f, MFVec3f | three floats | 0 0 0 | translation="0 1 0" |
SFVec4d, MFVec4d | four doubles, a homogeneous point | 0 0 0 1 | |
SFVec4f, MFVec4f | four floats, a homogeneous point | 0 0 0 1 |
Commas may stand between values anywhere a space may, so "0 0 0, 1 0 0"
and "0 0 0 1 0 0" are the same MFVec3f. Compared with
VRML97, X3D adds MFBool, the ColorRGBA,
Double, Matrix, Vec2d, Vec3d and
Vec4 types, and MFImage.
Access types
| Access type | VRML97 name | Meaning |
|---|---|---|
initializeOnly | field | set in the file, not changed by events |
inputOnly | eventIn | receives events; never written in a file |
outputOnly | eventOut | sends events; never written in a file |
inputOutput | exposedField | set in the file and changed by events |