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='ScriptSyntaxExampleTest.x3d'/> |
6 | <meta name='creator' content='Don Brutzman'/> |
7 | <meta name='created' content='8 January 2000'/> |
8 | <meta name='modified' content='20 October 2019'/> |
9 | <meta name='description' content='Script node syntax example, testing sample values of various types with simple escaping of apostrophe and quotation mark characters, with results shown on Browser console output.'/> |
10 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Basic/development/ScriptSyntaxExampleTest.x3d'/> |
11 | <meta name='generator' content='X3D-Edit, https://www.web3d.org/x3d/content/README.X3D-Edit.txt'/> |
12 | <meta name='license' content='../license.html'/> |
13 | </head> |
14 | <Scene> |
15 | <WorldInfo title='ScriptSyntaxExampleTest.x3d'/> |
16 | <Script DEF='myScript' url=' "NoSuchScript1.js" "https://www.web3d.org/x3d/content/examples/Basic/development/NoSuchScript2.class.ignore" '> |
17 | <field name='someSFBool' type='SFBool' accessType='inputOnly'/> |
18 | <field name='someMFInt32' type='MFInt32' accessType='outputOnly'/> |
19 | <field name='someMFFloats' type='MFFloat' value='0.0 1.0 2.0' accessType='initializeOnly'/> |
20 | <field name='someStringField' type='SFString' value='hello' accessType='initializeOnly'/> |
21 | <field name='stringTest1' type='MFString' value='"'" "apostrophe"' accessType='initializeOnly'/> |
22 | <field name='stringTest2' type='MFString' value='"Quote " character" "More Text"' accessType='initializeOnly'/> |
23 | <field name='someInitializedRotation' type='SFRotation' value='0 1 0 0' accessType='initializeOnly'/> |
24 | <field name='someInitializedTime' type='SFTime' value='0' accessType='initializeOnly'/> |
<![CDATA[
ecmascript: // Preferred style for inlined script code is contained CDATA // in order to simplify use of characters < > " " ' ' etc. in source code // When inlined script code appears in url instead, XML special characters // must be carefully 'escaped' or an incorrect translation will result. // url appears before contained code when translating to VRML encoding, // so that external (possibly updated) code scripts can take precedence function someSFBool (value, timestamp) { Browser.println ('someSFBool input event=' + value); someMFInt32 = 0; // set outputOnly event, for example } function initialize (value) { Browser.println (' someMFFloats=' + someMFFloats); Browser.println ('someStringField=' + someStringField); Browser.println (' stringTest1=' + stringTest1); Browser.println (' stringTest2=' + stringTest2); }
]]>
|
|
26 | </Script> |
27 | <Anchor description='Select text to view source documentation' url=' "ScriptSyntaxExampleTest.html" "https://www.web3d.org/x3d/content/examples/Basic/development/ScriptSyntaxExampleTest.html" '> |
28 | <Shape> |
29 | <Text string='"Script node syntax example," "select this text to view source"'> |
30 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
31 | </Text> |
32 | <Appearance> |
33 | <Material diffuseColor='0.7 0.4 0.1'/> |
34 | </Appearance> |
35 | </Shape> |
36 | <!-- selectable Text to show Anchor description --> |
37 | <Shape> |
38 | <Box size='11 2 .001'/> |
39 | <Appearance> |
40 | <Material transparency='1'/> |
41 | </Appearance> |
42 | </Shape> |
43 | </Anchor> |
44 | </Scene> |
45 | </X3D> |
Event Graph ROUTE Table with 0 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.
Anchor |
description='Select text to view source documentation' User-interaction hint for this node. |
<!--
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. -->