We refer to these three papers as; Interface proposal, sensors/triggers proposal and World's comparison paper respectively.
The latest version of this paper is 'Comments on interface and sensor/trigger proposal [6]' This paper references two others we have written: 'Extension to VRML1.0 [3]' which discusses our extensions to VRML and provides a number of examples of scripts to support behavior. 'An OO perspective on VRML [4]' this paper supports our approach by explaining our underlying philosophy
Kouichi Matsuda, Yasuaki Honda, Rodger Lea
{matsuda, honda, rodger}@csl.sony.co.jp
Sony Computer Science Laboratories Inc.
also with Central Research Center, Sony Corporation
DEF MyCubes CleverCube {
isA Separator
fields [ SFColor READWRITE cube1color ]
cube1color 0 0 1
Separator {
Material { emissiveColor USE MyCube.cube1color }
DEF cubeSensor PickSensor {
Cube { }
}
Trigger {
condition "cubeSensor.picked"
action "set MyCube.cube1color 1 0 0"
}
}
Cube { } # Second cube from article, no behavior
}
In our proposal, this example should like this:
Separator {
EventHandler {
eventType GRAB
function "set diffuseColor 1 0 0"
}
Cube {}
}
In this second example (again from the same paper) we see the use of a
script rather than the action. DEF MyCubes CleverCube {
isA Separator
fields [ SFColor READWRITE cube1color ]
cube1color 0 0 1
cube1 { Cube { } }
Separator {
Material { emissiveColor USE MyCube.cube1color }
DEF cubeSensor PickSensor {
target MyCubes.cube1
}
DEF MyBehavior Behavior {
language TCL
program "http://foo.com/change.tcl"
running FALSE
parameters [ SFNode, "USE MyCubes.cube1", SFColor, "1 0 0"]
}
Trigger {
condition "cubeSensor.picked"
action "set MyBehavior.running TRUE"
}
}
Cube { } # Second cube from article, no behavior
}
In our proposal, this example should like this: Separator {
EventHandler {
filename "http://foo.com/change.tcl"
eventType GRAB
function "change_color"
userData "red"
scriptType TCL
}
Cube {}
}
Referring to our proposal 'Sony's extensions to VRML [3]' we see that we have a simpler approach to behavior declaration. The EventHandler node is declared, and the object that has the script associated is declared immediately afterwards. (see event handler example) To share scripts we simply copy the event handler and re-use if for another cube.(see script sharing example) In essence our event handler combines the sensor and the trigger.
We believe that a more O-O view of VRML helps to do this. This is more fully explained in 'An O-O perspective on VRML [4]'. We believe that a strict interpretation of VRML1.1, i.e. the use of attributes associated with separaters is equivalent to our approach, however we are unclear from the VAG report if this strict interpretation is the only one. For example, is it still possible (as in VRML1.0) for an attribute to be 'inherited' simply because the attribute has been defined earlier in the syntactic ordering of the VRML file.