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='TestProtoInterfaceNodeScope.x3d'/> |
6 | <meta name='description' content='Test override of color values in prototypes and scripts. Color code: red = left-most default prototype interface, yellow = middle ProtoInstance fieldValue, green = Script initialization of middle ProtoInstance, blue = right-side default prototype instance.'/> |
7 | <meta name='creator' content='Alan Hudson, Don Brutzman'/> |
8 | <meta name='translator' content='Xeena VRML importer, X3D-Edit 3.1, https://www.web3d.org/x3d/content/README.X3D-Edit.html'/> |
9 | <meta name='created' content='4 January 2006'/> |
10 | <meta name='translated' content='5 January 2006'/> |
11 | <meta name='modified' content='9 October 2023'/> |
12 | <meta name='rights' content='Copyright (c) Web3D Consortium Inc. 2006'/> |
13 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Basic/development/TestProtoInterfaceNodeScope.x3d'/> |
14 | <meta name='generator' content='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/> |
15 | <meta name='generator' content='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/> |
16 | <meta name='license' content='../license.html'/> |
17 | </head> |
18 | <Scene> |
19 | <WorldInfo title='TestProtoInterfaceNodeScope.x3d'/> |
20 | <ProtoDeclare name='MyProto'> |
21 | <ProtoInterface> |
22 | <field name='material' type='SFNode' accessType='inputOutput'> |
23 | <Material diffuseColor='1 0 0'/> |
24 | </field> |
25 | </ProtoInterface> |
26 | <ProtoBody> |
27 | <Shape> |
28 | <Appearance> |
29 | <IS> |
30 | <connect nodeField='material' protoField='material'/> |
31 | </IS> |
32 | </Appearance> |
33 | <Box DEF='ProtoBox'/> |
34 | </Shape> |
35 | </ProtoBody> |
36 | </ProtoDeclare> |
37 | <Transform DEF='LeftTransform' translation='-2.5 0.0 0.0'> |
38 | <ProtoInstance name='MyProto' DEF='P1'/> |
39 | </Transform> |
40 | <Transform DEF='MiddleTransform'> |
41 | |
42 | <fieldValue name='material'> |
43 | <Material diffuseColor='0.7 0.7 0'/> |
44 | </fieldValue> |
45 | </ProtoInstance> |
46 | <Script DEF='SC' directOutput='true'> |
47 | <field name='proto1' type='SFNode' accessType='initializeOnly'> |
48 | <ProtoInstance USE='P2'/> |
49 | </field> |
<![CDATA[
ecmascript: function initialize() { Browser.println ('Changing color on middle box to green'); proto1.material.diffuseColor = new SFColor(0,1,0); }
]]>
|
|
51 | </Script> |
52 | </Transform> |
53 | <Transform DEF='RightTransform' translation='2.5 0.0 0.0'> |
54 | <ProtoInstance name='MyProto' DEF='P3'> |
55 | <fieldValue name='material'> |
56 | <Material diffuseColor='0 0 1'/> |
57 | </fieldValue> |
58 | </ProtoInstance> |
59 | </Transform> |
60 | <Switch whichChoice='-1'> |
61 | <Shape> |
62 | <!-- To test protected scope of nodes DEF'ed inside a prototype body, add: <Box USE="ProtoBox"/> --> |
63 | </Shape> |
64 | </Switch> |
65 | </Scene> |
66 | </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.
SC
Script |
No ROUTE connection found for output events from this node. Contains SFNode field with direct access to another node. |
P1
ProtoInstance MyProto |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
P2
ProtoInstance MyProto |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declaration with direct access to other nodes, and thus has potential to produce run-time animation. |
P3
ProtoInstance MyProto |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declaration with direct access to other nodes, and thus has potential to produce run-time animation. |
<!--
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)
<ProtoInstance
name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->