| 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=' SliderFloatExample.x3d '/> |
| 6 | <meta name='description' content='This is an example of the SliderFloatPrototype, showing a slider bar starting at 12 and ranging from 0 to 24.'/> |
| 7 | <meta name='creator' content='Jane Wu'/> |
| 8 | <meta name='created' content='17 October 2001'/> |
| 9 | <meta name='modified' content='28 November 2019'/> |
| 10 | <meta name=' TODO ' content=' slow it down, change to positive control by user selection '/> |
| 11 | <meta name='subject' content='float slider example'/> |
| 12 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/SliderFloatExample.x3d '/> |
| 13 | <meta name='generator' content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 14 | <meta name='license' content='../../license.html'/> |
| 15 | </head> |
| 16 | <Scene> |
| 17 | <WorldInfo title='SliderFloatExample.x3d'/> |
| 18 | <ExternProtoDeclare name='SliderFloat' appinfo='Slider user-interface widget that produces floating-point output values' url=' "SliderFloatPrototype.x3d#SliderFloat" "../../../Savage/Tools/Animation/SliderFloatPrototype.x3d#SliderFloat" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/SliderFloatPrototype.x3d#SliderFloat" "SliderFloatPrototype.wrl#SliderFloat" "../../../Savage/Tools/Animation/SliderFloatPrototype.wrl#SliderFloat" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/SliderFloatPrototype.wrl#SliderFloat" '> |
| 19 |
<field name='layoutDirection' type='SFString' accessType='initializeOnly'
appinfo='Allowed values: vertical, horizontal'/> |
| 20 |
<field name='height' type='SFFloat' accessType='initializeOnly'
appinfo='default value 1.0'/> |
| 21 |
<field name='radius' type='SFFloat' accessType='initializeOnly'
appinfo='default value 0.1'/> |
| 22 |
<field name='barRadius' type='SFFloat' accessType='initializeOnly'
appinfo='default value 0.02'/> |
| 23 |
<field name='sliderBarColor' type='SFColor' accessType='initializeOnly'
appinfo='default value .8 .4 .8'/> |
| 24 |
<field name='sliderBallColor' type='SFColor' accessType='initializeOnly'
appinfo='default value .3 .4 .8'/> |
| 25 |
<field name='sliderEndColor' type='SFColor' accessType='initializeOnly'
appinfo='default value .2 .3 .9'/> |
| 26 |
<field name='min' type='SFFloat' accessType='initializeOnly'
appinfo='default value 0.0'/> |
| 27 |
<field name='max' type='SFFloat' accessType='initializeOnly'
appinfo='default value 10.0'/> |
| 28 |
<field name='value' type='SFFloat' accessType='initializeOnly'
appinfo='default value 0.0'/> |
| 29 |
<field name='setMin' type='SFFloat' accessType='inputOnly'
appinfo='set minimum value for slider bar'/> |
| 30 |
<field name='setMax' type='SFFloat' accessType='inputOnly'
appinfo='set maximum value for slider bar'/> |
| 31 |
<field name='setValue' type='SFFloat' accessType='inputOnly'
appinfo='set value for slider bar'/> |
| 32 |
<field name='valueChanged' type='SFFloat' accessType='outputOnly'
appinfo='output value for slider bar'/> |
| 33 |
<field name='traceEnabled' type='SFBool' accessType='initializeOnly'
appinfo='enable/disable console output for troubleshooting'/> |
| 34 | </ExternProtoDeclare> |
| 35 | <ExternProtoDeclare name='SingleTypeConversion' appinfo='SingleTypeConversion converts from a single typed value to various other types of values' url=' "../../../Savage/Tools/Authoring/SingleTypeConversionPrototype.x3d#SingleTypeConversion" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/SingleTypeConversionPrototype.x3d#SingleTypeConversion" "../../../Savage/Tools/Authoring/SingleTypeConversionPrototype.wrl#SingleTypeConversion" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/SingleTypeConversionPrototype.wrl#SingleTypeConversion" '> |
| 36 |
<field name='decimalPlaces' type='SFInt32' accessType='initializeOnly'
appinfo='decimalPlaces is the number of significant digits after the decimal point, use -1 to indicate no round off'/> |
| 37 | <field name='setDecimalPlaces' type='SFInt32' accessType='inputOnly'/> |
| 38 | <field name='BooleanValue' type='SFBool' accessType='inputOnly'/> |
| 39 | <field name='FloatValue' type='SFFloat' accessType='inputOnly'/> |
| 40 | <field name='IntegerValue' type='SFInt32' accessType='inputOnly'/> |
| 41 | <field name='BooleanResult' type='SFBool' accessType='outputOnly'/> |
| 42 | <field name='FloatResult' type='SFFloat' accessType='outputOnly'/> |
| 43 | <field name='IntegerResult' type='SFInt32' accessType='outputOnly'/> |
| 44 | <field name='StringResult' type='SFString' accessType='outputOnly'/> |
| 45 | <field name='StringsResult' type='MFString' accessType='outputOnly'/> |
| 46 | <field name='TimeResult' type='SFTime' accessType='outputOnly'/> |
| 47 | <field name='TimeValue' type='SFTime' accessType='inputOnly'/> |
| 48 | </ExternProtoDeclare> |
| 49 | <!-- Scene graph begins here --> |
| 50 | <Viewpoint description='Drag slider ball to change values' position='0 1 9'/> |
| 51 | <Billboard axisOfRotation='0 0 0'> |
| 52 | <Transform translation='0 2.5 0'> |
| 53 | <Shape> |
| 54 | <Appearance> |
| 55 | <Material diffuseColor='0 1 1'/> |
| 56 | </Appearance> |
| 57 | <Text string=' "Drag slider ball" "to change values," "select end stops to" "increment/decrement" '> |
| 58 |
<!-- FontStyle
FontOutputText is a DEF node that has 1 USE node: USE_1 --> <FontStyle DEF='FontOutputText' justify='"MIDDLE" "MIDDLE"' size='0.9'/> |
| 59 | </Text> |
| 60 | </Shape> |
| 61 | </Transform> |
| 62 | <Transform translation='-0.8 -0.7 0'> |
| 63 | <Shape> |
| 64 | <Appearance> |
| 65 | <Material/> |
| 66 | </Appearance> |
| 67 |
<!-- ROUTE information for ResultString node:
[from FloatConverter.StringsResult to set_string
]
-->
<Text DEF='ResultString'> |
| 68 | <FontStyle USE='FontOutputText'/> |
| 69 | </Text> |
| 70 | </Shape> |
| 71 | </Transform> |
| 72 | <Transform translation='0 -2 0'> |
| 73 |
<!-- ROUTE information for SliderExample node:
[from valueChanged to FloatConverter.FloatValue
]
-->
<ProtoInstance name='SliderFloat' DEF='SliderExample'> |
| 74 | <fieldValue name='layoutDirection' value='horizontal'/> |
| 75 | <fieldValue name='height' value='5'/> |
| 76 | <fieldValue name='radius' value='0.1'/> |
| 77 | <fieldValue name='barRadius' value='0.04'/> |
| 78 | <fieldValue name='sliderBarColor' value='0.75 0.75 0.75'/> |
| 79 | <fieldValue name='min' value='0.0'/> |
| 80 | <fieldValue name='max' value='24.0'/> |
| 81 | <fieldValue name='value' value='12.0'/> |
| 82 | <fieldValue name='traceEnabled' value='true'/> |
| 83 | </ProtoInstance> |
| 84 | </Transform> |
| 85 | </Billboard> |
| 86 |
<!-- ROUTE information for FloatConverter node:
[from SliderExample.valueChanged to FloatValue
]
[from StringsResult to ResultString.set_string
]
-->
<ProtoInstance name='SingleTypeConversion' DEF='FloatConverter'> |
| 87 | <fieldValue name='decimalPlaces' value='2'/> |
| 88 | </ProtoInstance> |
| 89 | < ROUTE fromNode='SliderExample' fromField='valueChanged' toNode='FloatConverter' toField='FloatValue'/> |
| 90 | < ROUTE fromNode='FloatConverter' fromField='StringsResult' toNode='ResultString' toField='set_string'/> |
| 91 | </Scene> |
| 92 | </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.
|
FloatConverter
ProtoInstance StringsResult MFString |
ResultString
Text set_string MFString |
|
SliderExample
ProtoInstance valueChanged SFFloat |
FloatConverter
ProtoInstance FloatValue SFFloat |
then
|
FloatConverter
ProtoInstance StringsResult MFString |
ResultString
Text set_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)
<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.
-->