Virtual Reality Toolbox | ![]() ![]() |
VRML Data Class Types
A node can contain four classes of data: field
, exposedField
, eventIn
, and eventOut
. These classes define the behavior of the nodes, the way the nodes are stored in the computer memory, and how they can interact with other nodes and external objects.
eventIn
Usually, eventIn
events correspond to a field in the node. Node fields are not accessible from outside the node. The only way you can change them is by having a corresponding eventIn
.
Some nodes have eventIn
events that do not correspond to any field of that node, but provide additional functionality for it. For example, the Transform node has an addChildren eventIn
. When this event is received, the child nodes that are passed are added to the list of children of a given transform.
You use this class type for fields that are exposed to other objects.
eventOut
This event is sent whenever the value of a corresponding node field that allows sending events changes its value.
You use this class type for fields that have this functionality.
field
A field can be set to a particular value in the VRML file. Generally, the field is private to the node and its value can be changed only if its node receives a corresponding eventIn
. It is important to understand that the field itself cannot be changed on the fly by other nodes or via the external authoring interface.
You use this class type for fields that are not exposed and do not have the eventOut
functionality.
exposedField
This is a powerful VRML data class that serves many purposes. You use this class type for fields that have both eventIn
and eventOut
functionality. The alternative name of the corresponding eventIn
is always the field name with a set_
prefix. The name of the eventOut
is always the field name with a _changed
suffix.
The exposedField
class defines how the corresponding eventIn
and eventOut
behave. For all exposedField
classes, when an event occurs, the field value is changed, with a corresponding change to the scene appearance, and an eventOut
is sent with the new field value. This allows the chaining of events through many nodes.
The exposedField
class is accessible to scripts, whereas the field
class is not.
![]() | VRML Field Data Types | Block Reference | ![]() |