1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
|
3 | <X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'> |
4 | <head> |
5 | <meta name='title' content='StringSensorExample.x3d'/> |
6 | <meta name='description' content='A StringSensor example that displays typed text in the world.'/> |
7 | <meta name='creator' content='Leonard Daly and Don Brutzman'/> |
8 | <meta name='created' content='7 June 2006'/> |
9 | <meta name='modified' content='25 August 2023'/> |
10 | <meta name='reference' content='https://X3dGraphics.com'/> |
11 | <meta name='reference' content='https://www.web3d.org/x3d/content/examples/X3dResources.html'/> |
12 | <meta name='rights' content='Copyright (c) 2006, Daly Realism and Don Brutzman'/> |
13 | <meta name='subject' content='X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com'/> |
14 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/StringSensorExample.x3d'/> |
15 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
16 | <meta name='license' content='../license.html'/> |
17 | </head> |
18 | <Scene> |
19 | <WorldInfo title='StringSensorExample.x3d'/> |
20 | <Background skyColor='1 1 1'/> |
21 | <Viewpoint description='Book View' position='-0.02 0.01 6.85'/> |
22 |
<!-- ROUTE information for GenText node:
[from enteredText to Converter.SFString_MFString
]
-->
<StringSensor DEF='GenText'/> |
23 | <Transform translation='0 0.8 0'> |
24 | <Transform translation='0 0 -.1'> |
25 | <Shape> |
26 | <Appearance> |
27 | <Material diffuseColor='1 1 .6'/> |
28 | </Appearance> |
29 | <Box size='8 1.5 .01'/> |
30 | </Shape> |
31 | </Transform> |
32 | <Transform translation='-3.8 0.2 0'> |
33 | <Shape> |
34 | <Appearance> |
35 | <Material diffuseColor='0 0 1'/> |
36 | </Appearance> |
37 |
<!-- ROUTE information for DisplayText node:
[from Converter.MFString_out to string
]
-->
<Text DEF='DisplayText'> |
38 | <FontStyle justify='"BEGIN" "MIDDLE"' size='0.75'/> |
39 | </Text> |
40 | </Shape> |
41 | </Transform> |
42 | <!-- convert StringSensor SFString into Text node MFString by using explicit typecasting in ECMAScript --> |
43 |
<!-- ROUTE information for Converter node:
[from GenText.enteredText to SFString_MFString
]
[from MFString_out to DisplayText.string
]
-->
<Script DEF='Converter' url=' "StringSensorScriptConverter.js" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/StringSensorScriptConverter.js" '> |
44 | <field name='SFString_MFString' type='SFString' accessType='inputOnly'/> |
45 | <field name='MFString_out' type='MFString' accessType='outputOnly'/> |
46 | <field name='SFFloat_Xout' type='SFFloat' accessType='outputOnly'/> |
47 | <field name='SFFloat_Yout' type='SFFloat' accessType='outputOnly'/> |
48 | <field name='SFFloat_Zout' type='SFFloat' accessType='outputOnly'/> |
49 | </Script> |
50 | < ROUTE fromNode='GenText' fromField='enteredText' toNode='Converter' toField='SFString_MFString'/> |
51 | < ROUTE fromNode='Converter' fromField='MFString_out' toNode='DisplayText' toField='string'/> |
52 | <Transform translation='0 -1.25 0'> |
53 | <Group> |
54 | <Shape> |
55 | <Text string='"StringSensor lets users enter text..." "please type to test"'> |
56 | <FontStyle family='"SANS"' justify='"MIDDLE" "BEGIN"' size='0.5'/> |
57 | </Text> |
58 | <Appearance> |
59 | <Material diffuseColor='0.7 0.7 0.7'/> |
60 | </Appearance> |
61 | </Shape> |
62 | </Group> |
63 | </Transform> |
64 | </Transform> |
65 | </Scene> |
66 | </X3D> |
Event Graph ROUTE Table entries with 2 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.
GenText
StringSensor enteredText SFString |
Converter
Script SFString_MFString SFString |
then
|
Converter
Script MFString_out MFString |
DisplayText
Text string MFString |
<!--
Color-coding 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. -->