1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
|
3 | <X3D profile='Immersive' version='3.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'> |
4 | <head> |
5 | <meta name='title' content='ScriptNodeEventOutControl_Java.x3d'/> |
6 | <meta name='description' content='Script node interface between VRML and Java: this conformance example tests event-based VRML-Java functionality.'/> |
7 | <meta name='creator' content='Don Brutzman'/> |
8 | <meta name=' warning ' content=' VRML97 script classes, not X3D Scene Authoring Interface (SAI) '/> |
9 | <meta name='created' content='30 November 1997'/> |
10 | <meta name='translated' content='8 July 2001'/> |
11 | <meta name='modified' content='20 October 2019'/> |
12 | <meta name='Image' content='ScriptEventPassingVrmlJava.png'/> |
13 | <meta name='Image' content='ScriptFieldInvocationVrmlJava.png'/> |
14 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Basic/ScriptConformance/ScriptNodeEventOutControl_Java.x3d'/> |
15 | <meta name='reference' content='VRML 97 Specification, Annex B, Java platform scripting reference'/> |
16 | <meta name='reference' content='https://www.web3d.org/technicalinfo/specifications/vrml97/part1/java.html'/> |
17 | <meta name='reference' content='https://www.web3d.org/technicalinfo/specifications/vrml97/part1/java.html#B.5'/> |
18 | <meta name='reference' content='Don Brutzman, "The Virtual Reality Modeling Language and Java," Communications of the ACM, vol. 41 no. 6, June 1998, pp. 57-64.'/> |
19 | <meta name='reference' content='VrmlJavaPaper.pdf'/> |
20 | <meta name='reference' content='ScriptNodeEventOutControl.java'/> |
21 | <meta name='reference' content='VRML97javadoc/index.html'/> |
22 | <meta name='reference' content='Makefile'/> |
23 | <meta name='reference' content='Makefile.out'/> |
24 | <meta name='reference' content='Vrml97ScriptNodePackages.jar'/> |
25 | <meta name='reference' content='ScriptNodeEventOutControl_JavaConsoleOutput.txt'/> |
26 | <meta name='reference' content='ScriptNodeEventOutControl_JavaSnapshots.html'/> |
27 | <meta name='reference' content='ScriptNodeEventOutControl_EcmaScript.x3d'/> |
28 | <meta name='subject' content='VRML X3D Java Script conformance'/> |
29 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
30 | <meta name='license' content='../license.html'/> |
31 | </head> |
32 | <Scene> |
33 | <WorldInfo title='ScriptNodeEventOutControl_Java.x3d'/> |
34 | <Viewpoint description='View test' position='0 0 12'/> |
35 | <Group> |
36 |
<!-- ROUTE information for ClickTextToTest node:
[from touchTime to InterfaceScriptNode.startTime
]
-->
<TouchSensor DEF='ClickTextToTest' description='Click text to test'/> |
37 |
<!-- ROUTE information for TextPosition node:
[from InterfaceScriptNode.changedPosition to set_translation
]
-->
<Transform DEF='TextPosition'> |
38 | <!-- TextPosition translation is modified by InterfaceScriptNode. --> |
39 | <Shape> |
40 |
<!-- ROUTE information for MessageToUser node:
[from InterfaceScriptNode.changedText to set_string
]
-->
<Text DEF='MessageToUser' string='"Default text in VRML scene will be replaced by" "Java initialize() in Script using EventOut control." "This text appears first, if Java initialization fails." ""'> |
41 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.8'/> |
42 | </Text> |
43 | <Appearance> |
44 |
<!-- ROUTE information for TextMaterial node:
[from InterfaceScriptNode.changedColor to diffuseColor
]
-->
<Material DEF='TextMaterial' diffuseColor='0.8 0.2 0.2' shininess='0.9'/> |
45 | </Appearance> |
46 | </Shape> |
47 | <!-- Selectable Text design pattern has transparent Box and TouchSensor description as a tooltip --> |
48 | <Shape> |
49 | <Box size='15 4 .001'/> |
50 | <Appearance> |
51 | <Material transparency='0.95'/> |
52 | </Appearance> |
53 | </Shape> |
54 | </Transform> |
55 | <!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) --> |
56 |
<!-- ROUTE information for InterfaceScriptNode node:
[from ClickTextToTest.touchTime to startTime
]
[from changedText to MessageToUser.set_string
]
[from changedPosition to TextPosition.set_translation
]
[from changedColor to TextMaterial.diffuseColor
]
-->
<Script DEF='InterfaceScriptNode' url=' "ScriptNodeEventOutControl.class" "https://www.web3d.org/x3d/content/examples/Basic/ScriptConformance/ScriptNodeEventOutControl.class" '> |
57 | <!-- No default values are allowed for eventIn or eventOut. --> |
58 | <field name='startTime' type='SFTime' accessType='inputOnly'/> |
59 | <field name='changedText' type='MFString' accessType='outputOnly'/> |
60 | <field name='changedPosition' type='SFVec3f' accessType='outputOnly'/> |
61 | <field name='changedColor' type='SFColor' accessType='outputOnly'/> |
62 | </Script> |
63 | </Group> |
64 | < ROUTE fromNode='ClickTextToTest' fromField='touchTime' toNode='InterfaceScriptNode' toField='startTime'/> |
65 | < ROUTE fromNode='InterfaceScriptNode' fromField='changedText' toNode='MessageToUser' toField='set_string'/> |
66 | < ROUTE fromNode='InterfaceScriptNode' fromField='changedPosition' toNode='TextPosition' toField='set_translation'/> |
67 | < ROUTE fromNode='InterfaceScriptNode' fromField='changedColor' toNode='TextMaterial' toField='diffuseColor'/> |
68 | </Scene> |
69 | </X3D> |
Event Graph ROUTE Table entries with 4 ROUTE connections total, showing X3D event-model relationships for this scene.
Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.
ClickTextToTest
TouchSensor touchTime SFTime |
InterfaceScriptNode
Script startTime SFTime |
then
|
InterfaceScriptNode
Script changedColor SFColor |
TextMaterial
Material diffuseColor SFColor |
||
then
|
InterfaceScriptNode
Script changedPosition SFVec3f |
TextPosition
Transform set_translation SFVec3f |
||||
then
|
InterfaceScriptNode
Script changedText MFString |
MessageToUser
Text set_string MFString |
<!--
Color legend: X3D terminology
<X3dNode
DEF='idName' field='value'/>
matches XML terminology
<XmlElement
DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement)
(Grey background inside box: inserted documentation)
(Magenta background: X3D Extensibility)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->