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=' MaterialToggleExample.x3d '/> |
6 | <meta name='description' content='Example for toggle-able Material node that can switch between 2 sets of material values, selectable at run time.'/> |
7 | <meta name='creator' content='Don Brutzman and MV4205 class'/> |
8 | <meta name='created' content='2 May 2004'/> |
9 | <meta name='modified' content='28 November 2019'/> |
10 | <meta name='reference' content=' MaterialTogglePrototype.x3d '/> |
11 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/MaterialToggleExample.x3d '/> |
12 | <meta name='generator' content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
13 | <meta name='license' content='../../license.html'/> |
14 | </head> |
15 | <Scene> |
16 | <WorldInfo title='MaterialToggleExample.x3d'/> |
17 | <ExternProtoDeclare name='MaterialToggle' appinfo='MaterialToggle selects one of two different Material values' url=' "MaterialTogglePrototype.x3d#MaterialToggle" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/MaterialTogglePrototype.x3d#MaterialToggle" "MaterialTogglePrototype.wrl#MaterialToggle" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/MaterialTogglePrototype.wrl#MaterialToggle" '> |
18 | <field name='set_toggle' type='SFBool' accessType='inputOnly'/> |
19 |
<field name='toggle' type='SFBool' accessType='initializeOnly'
appinfo='whether to use DefaultMaterial or ToggleMaterial'/> |
20 | <field name='toggle_changed' type='SFBool' accessType='outputOnly'/> |
21 |
<field name='defaultMaterial' type='SFNode' accessType='initializeOnly'
appinfo='Material node that is enabled when toggle=false'/> |
22 |
<field name='toggleMaterial' type='SFNode' accessType='initializeOnly'
appinfo='Material node that is enabled when toggle=true'/> |
23 |
<field name='set_defaultMaterial' type='SFNode' accessType='inputOnly'
appinfo='provide replacement default Material node'/> |
24 |
<field name='set_toggleMaterial' type='SFNode' accessType='inputOnly'
appinfo='provide replacement toggle Material node'/> |
25 | </ExternProtoDeclare> |
26 | <!-- ==================== --> |
27 | <Viewpoint description='touch box to toggle material' orientation='1 0 0 -0.79' position='0 5 5'/> |
28 | <Transform rotation='0 1 0 0.79'> |
29 | <Shape> |
30 | <Box/> |
31 | <Appearance> |
32 |
<!-- ROUTE information for MT node:
[from TS.isActive to set_toggle
]
-->
<ProtoInstance name='MaterialToggle' DEF='MT' containerField='material'> |
33 | <fieldValue name='toggle' value='true'/> |
34 | <fieldValue name='defaultMaterial'> |
35 | <Material ambientIntensity='0.24' diffuseColor='1 0.452381 0.40339' shininess='0.9' specularColor='0.686486 0.396903 0.419275'> |
36 | <!-- Universal Media Library: ArtDeco 3 --> |
37 | </Material> |
38 | </fieldValue> |
39 | <fieldValue name='toggleMaterial'> |
40 | <Material ambientIntensity='0.24' diffuseColor='0.330519 0.3389 0.6' shininess='0.78' specularColor='0.290909 0.290909 0.290909'> |
41 | <!-- Universal Media Library: ArtDeco 8 --> |
42 | </Material> |
43 | </fieldValue> |
44 | </ProtoInstance> |
45 | </Appearance> |
46 | </Shape> |
47 |
<!-- ROUTE information for TS node:
[from isActive to MT.set_toggle
]
-->
<TouchSensor DEF='TS' description='touch to toggle'/> |
48 | < ROUTE fromNode='TS' fromField='isActive' toNode='MT' toField='set_toggle'/> |
49 | </Transform> |
50 | </Scene> |
51 | </X3D> |
Event Graph ROUTE Table with 1 ROUTE connection 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.
TS
TouchSensor isActive SFBool |
MT
ProtoInstance set_toggle SFBool |
MT
ProtoInstance MaterialToggle |
No direct ROUTE connection found for events to/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. |
<!--
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)
<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.
-->