X3D Model Documentation: ScriptNodeEventOutControl_Java.x3d

  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='titlecontent='ScriptNodeEventOutControl_Java.x3d'/>
  6            <meta name='descriptioncontent='Script node interface between VRML and Java: this conformance example tests event-based VRML_Java functionality.'/>
  7            <meta name='creatorcontent='Don Brutzman'/>
  8            <meta name='createdcontent='30 November 1997'/>
  9            <meta name='translatedcontent='8 July 2001'/>
 10            <meta name='modifiedcontent='28 August 2023'/>
 11            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/ScriptConformance/ScriptNodeEventOutControl_Java.x3d'/>
 12            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/ConformanceNist/Miscellaneous/Script/ScriptNodeEventOutControl_Java.x3d'/>
 13            <meta name='referencecontent='VRML 97 Specification, Annex B, Java platform scripting reference'/>
 14            <meta name='referencecontent='https://www.web3d.org/technicalinfo/specifications/vrml97/part1/java.html'/>
 15            <meta name='referencecontent='https://www.web3d.org/technicalinfo/specifications/vrml97/part1/java.html#B.5'/>
 16            <meta name='referencecontent='Don Brutzman, "The Virtual Reality Modeling Language and Java," Communications of the ACM, vol. 41 no. 6, June 1998, pp. 57-64.'/>
 17            <meta name='referencecontent='VrmlJavaPaper.pdf'/>
 18            <meta name='referencecontent='ScriptNodeEventOutControl.java'/>
 19            <meta name='referencecontent='javadoc/index.html'/>
 20            <meta name='referencecontent='Makefile'/>
 21            <meta name='referencecontent='Makefile.out'/>
 22            <meta name='referencecontent='Vrml97ScriptNodePackages.jar'/>
 23            <meta name='referencecontent='ScriptNodeEventOutControl_JavaConsoleOutput.txt'/>
 24            <meta name='referencecontent='ScriptNodeEventOutControl_JavaSnapshots.html'/>
 25            <meta name='referencecontent='ScriptNodeEventOutControl-EcmaScript.x3d'/>
 26            <meta name='subjectcontent='VRML X3D Java Script conformance'/>
 27            <meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
 28            <meta name='licensecontent='../../license.html'/>
 29       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: ClickTextToTest, InterfaceScriptNode, MessageToUser, TextMaterial, TextPosition

Index for Viewpoint node: Viewpoint_1
-->
 30       <Scene>
 31            <WorldInfo title='ScriptNodeEventOutControl_Java.x3d'/>
 32            <Viewpoint description='View testposition='0 0 12'/>
 33            <Group>
 34 
               <!-- ROUTE information for ClickTextToTest node:  [from touchTime to InterfaceScriptNode.startTime ] -->
               <TouchSensor DEF='ClickTextToTestdescription='Click text to test'/>
 35 
               <!-- ROUTE information for TextPosition node:  [from InterfaceScriptNode.changedPosition to set_translation ] -->
               <Transform DEF='TextPosition'>
 36                      <!-- TextPosition translation is modified by InterfaceScriptNode. -->
 37                      <Shape>
 38 
                         <!-- ROUTE information for MessageToUser node:  [from InterfaceScriptNode.changedText to set_string ] -->
                         <Text DEF='MessageToUser'>
 39                                <FontStyle justify='"MIDDLE" "MIDDLE"size='0.8'/>
 40                           </Text>
 41                           <Appearance>
 42 
                              <!-- ROUTE information for TextMaterial node:  [from InterfaceScriptNode.changedColor to diffuseColor ] -->
                              <Material DEF='TextMaterialdiffuseColor='0.8 0.2 0.2shininess='0.9'/>
 43                           </Appearance>
 44                      </Shape>
 45                 </Transform>
 46                 <!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) -->
 47 
 48                      <!-- No default values are allowed for eventIn or eventOut. -->
 49                      <field name='startTimetype='SFTimeaccessType='inputOnly'/>
 50                      <field name='changedTexttype='MFStringaccessType='outputOnly'/>
 51                      <field name='changedPositiontype='SFVec3faccessType='outputOnly'/>
 52                      <field name='changedColortype='SFColoraccessType='outputOnly'/>
 53                 </Script>
 54            </Group>
 55            < ROUTE  fromNode='ClickTextToTest' fromField='touchTime' toNode='InterfaceScriptNode' toField='startTime'/>
 56            < ROUTE  fromNode='InterfaceScriptNode' fromField='changedText' toNode='MessageToUser' toField='set_string'/>
 57            < ROUTE  fromNode='InterfaceScriptNode' fromField='changedPosition' toNode='TextPosition' toField='set_translation'/>
 58            < ROUTE  fromNode='InterfaceScriptNode' fromField='changedColor' toNode='TextMaterial' toField='diffuseColor'/>
 59       </Scene>
 60  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: ClickTextToTest, InterfaceScriptNode, MessageToUser, TextMaterial, TextPosition

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: Appearance, field, FontStyle, Group, head, Material, meta, ROUTE, Scene, Script, Shape, Text, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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

ROUTE
event to
(1)
InterfaceScriptNode
Script
startTime
SFTime
then
 
 
 
InterfaceScriptNode
Script
changedColor
SFColor

ROUTE
event to
(2)
TextMaterial
Material
diffuseColor
SFColor
  then
 
 
 
InterfaceScriptNode
Script
changedPosition
SFVec3f

ROUTE
event to
(2)
TextPosition
Transform
set_translation
SFVec3f
  then
 
 
 
InterfaceScriptNode
Script
changedText
MFString

ROUTE
event to
(2)
MessageToUser
Text
set_string
MFString

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/ConformanceNist/Miscellaneous/Script/ScriptNodeEventOutControl_JavaIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/ConformanceNist/Miscellaneous/Script/ScriptNodeEventOutControl_Java.x3d -->

<!-- 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)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->