X3D Model Documentation: WheelsFrontPrototype.x3d

  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='titlecontent=' WheelsFrontPrototype.x3d '/>
  6            <meta name='descriptioncontent='This prototype performs raising and lowering front wheels and axle. The clickable axle triggers an animation based on the boolean.'/>
  7            <meta name='creatorcontent='Etsuko Lippi, Jane Wu'/>
  8            <meta name='createdcontent='11 July 2001'/>
  9            <meta name='modifiedcontent='20 October 2019'/>
 10            <meta name='generatorcontent='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 11            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.x3d '/>
 12            <meta name='subjectcontent='front wheels prototype, gear up and down'/>
 13            <meta name='licensecontent='../../license.html'/>
 14       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: axis, black, black1, Clock, ClockAxleGearUpDown, GearUpDownInterpolator, GearUpDownScript, Hub, inside_wheel, inside_wheel2, mainAxle, wheel, wheel2, WheelInterpolator, WheelsFrontAxleTransform, WheelTouchSensor, WheelTransform, white, white1

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2

Index for ProtoDeclare definition: WheelsFront
-->
 15       <Scene>
 16            <WorldInfo title='WheelsFrontPrototype.x3d'/>
 17            <ProtoDeclare name='WheelsFront'>
 18                 <ProtoInterface>
 19                      <field name='gearuptype='SFBoolaccessType='inputOnly'
                     appinfo='boolean eventIn: true = wheels up false = wheels down.'/>
 20                      <field name='animationStartTimetype='SFTimeaccessType='inputOnly'/>
 21                      <field name='gearupOuttype='SFBoolaccessType='outputOnly'/>
 22                      <field name='traceEnabledtype='SFBoolvalue='falseaccessType='initializeOnly'/>
 23                 </ProtoInterface>
 24                 <ProtoBody>
 25                      <Group>
 26 
                         <!-- ROUTE information for WheelsFrontAxleTransform node:  [from GearUpDownInterpolator.value_changed to set_rotation ] -->
                         <Transform DEF='WheelsFrontAxleTransformcenter='0 3 0'>
 27                                <Group>
 28                                     <!-- wheels axis connecting to fuselage -->
 29 
                                   <!-- ROUTE information for WheelTransform node:  [from WheelInterpolator.value_changed to set_rotation ] -->
                                   <Transform DEF='WheelTransform'>
 30                                          <Transform scale='0.3 0.3 0.3'>
 31                                               <Transform rotation='0 1 0 1.571'>
 32                                                    <Shape DEF='wheel'>
 33                                                         <Appearance>
 34                                                              <Material DEF='black1diffuseColor='0 0 0shininess='0.125specularColor='0.2 0.2 0.2'/>
 35                                                         </Appearance>
 36                                                         <Extrusion creaseAngle='3.14crossSection='0.00 1.30 .494 1.196 .923 .923 1.196 .494 1.30 0.00 1.196 -.494 .923 -.923 .494 -1.196 0.00 -1.30spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/>
 37                                                    </Shape>
 38                                                    <Shape DEF='inside_wheel'>
 39                                                         <Appearance>
 40 
                                                            <!-- Material white1 is a DEF node that has 1 USE node: USE_1 -->
                                                            <Material DEF='white1diffuseColor='1 1 1'/>
 41                                                         </Appearance>
 42                                                         <Extrusion crossSection='0.00 1.30 0.10 1.30 0.10 0.00 0.10 -1.30 0.00 -1.30 0.00 0.00 0.00 1.30spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/>
 43                                                    </Shape>
 44                                               </Transform>
 45                                               <Transform rotation='0 1 0 1.571'>
 46                                                    <Shape>
 47                                                         <Appearance>
 48                                                              <Material USE='white1'/>
 49                                                         </Appearance>
 50                                                         <Extrusion crossSection='-0.10 1.30 0.00 1.30 0.00 0.00 0.00 -1.30 -0.10 -1.30 -0.10 0.00 -0.10 1.30spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/>
 51                                                    </Shape>
 52                                               </Transform>
 53                                               <Transform rotation='0 1 0 1.571'>
 54                                                    <Shape>
 55                                                         <Appearance>
 56                                                              <Material diffuseColor='0 0.25 0.5'/>
 57                                                         </Appearance>
 58                                                         <Extrusion crossSection='-0.30 1.30 -0.10 1.30 -0.10 0.00 -0.10 -1.30 -0.30 -1.30 -0.30 0.00 -0.30 1.30spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/>
 59                                                    </Shape>
 60                                               </Transform>
 61                                          </Transform>
 62                                          <Transform translation='0 0 0.30'>
 63 
                                             <!-- Inline Hub is a DEF node that has 3 USE nodes: USE_1, USE_2, USE_3 -->
                                             <Inline DEF='Hub'   url=' "Hub.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18/Hub.wrl" "Hub.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18/Hub.x3d" '/>
 64                                          </Transform>
 65                                          <Transform translation='0 0 -0.30'>
 66                                               <Inline USE='Hub'/>
 67                                          </Transform>
 68 
                                        <!-- ROUTE information for WheelTouchSensor node:  [from isOver to Clock.set_enabled ] -->
                                        <TouchSensor DEF='WheelTouchSensordescription='click to retract'/>
 69 
                                        <!-- ROUTE information for Clock node:  [from WheelTouchSensor.isOver to set_enabled ] [from fraction_changed to WheelInterpolator.set_fraction ] -->
                                        <TimeSensor DEF='ClockcycleInterval='0.5enabled='falseloop='true'/>
 70 
                                        <!-- ROUTE information for WheelInterpolator node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to WheelTransform.set_rotation ] -->
                                        <OrientationInterpolator DEF='WheelInterpolatorkey='0 0.5 1.0keyValue='0 0 1 0.0 0 0 1 3.14 0 0 1 6.28'/>
 71                                          < ROUTE  fromNode='WheelTouchSensor' fromField='isOver' toNode='Clock' toField='set_enabled'/>
 72                                          < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='WheelInterpolator' toField='set_fraction'/>
 73                                          < ROUTE  fromNode='WheelInterpolator' fromField='value_changed' toNode='WheelTransform' toField='set_rotation'/>
 74                                          <Transform scale='0.3 0.3 0.3translation='0 0 1.5'>
 75                                               <Transform rotation='0 1 0 1.571'>
 76                                                    <Shape DEF='wheel2'>
 77                                                         <Appearance>
 78                                                              <Material DEF='blackdiffuseColor='0 0 0shininess='0.125specularColor='0.2 0.2 0.2'/>
 79                                                         </Appearance>
 80                                                         <Extrusion creaseAngle='3.14crossSection='0.00 1.30 .494 1.196 .923 .923 1.196 .494 1.30 0.00 1.196 -.494 .923 -.923 .494 -1.196 0.00 -1.30spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/>
 81                                                    </Shape>
 82                                                    <Shape DEF='inside_wheel2'>
 83                                                         <Appearance>
 84 
                                                            <!-- Material white is a DEF node that has 1 USE node: USE_1 -->
                                                            <Material DEF='whitediffuseColor='1 1 1'/>
 85                                                         </Appearance>
 86                                                         <Extrusion crossSection='0.00 1.30 0.10 1.30 0.10 0.00 0.10 -1.30 0.00 -1.30 0.00 0.00 0.00 1.30spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/>
 87                                                    </Shape>
 88                                               </Transform>
 89                                               <Transform rotation='0 1 0 1.571'>
 90                                                    <Shape>
 91                                                         <Appearance>
 92                                                              <Material USE='white'/>
 93                                                         </Appearance>
 94                                                         <Extrusion crossSection='-0.10 1.30 0.00 1.30 0.00 0.00 0.00 -1.30 -0.10 -1.30 -0.10 0.00 -0.10 1.30spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/>
 95                                                    </Shape>
 96                                               </Transform>
 97                                               <Transform rotation='0 1 0 1.571'>
 98                                                    <Shape>
 99                                                         <Appearance>
100                                                              <Material diffuseColor='0 0.25 0.5'/>
101                                                         </Appearance>
102                                                         <Extrusion crossSection='-0.30 1.30 -0.10 1.30 -0.10 0.00 -0.10 -1.30 -0.30 -1.30 -0.30 0.00 -0.30 1.30spine='0 0 1.30 0 .494 1.196 0 .923 .923 0 1.196 .494 0 1.30 0.00 0 1.196 -.494 0 .923 -.923 0 .494 -1.196 0 0.00 -1.30 0 -.494 -1.196 0 -.923 -.923 0 -1.196 -.494 0 -1.30 0 0 -1.196 .494 0 -.923 .923 0 -.494 1.196 0 0.00 1.30'/>
103                                                    </Shape>
104                                               </Transform>
105                                          </Transform>
106                                          <Transform translation='0 0 1.80'>
107                                               <Inline USE='Hub'/>
108                                          </Transform>
109                                          <Transform translation='0 0 1.20'>
110                                               <Inline USE='Hub'/>
111                                          </Transform>
112                                     </Transform>
113                                </Group>
114                                <Group>
115                                     <Transform>
116                                          <Transform translation='0 0.55 0.75'>
117                                               <Shape>
118 
                                                  <!-- Appearance axis is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                                                  <Appearance DEF='axis'>
119                                                         <Material ambientIntensity='0.3diffuseColor='0.3 0.3 0.3shininess='0.20specularColor='0.50 0.50 0.60'/>
120                                                    </Appearance>
121                                                    <Cylinder height='1radius='0.08'/>
122                                               </Shape>
123                                          </Transform>
124                                          <Transform rotation='1 0 0 1.57scale='0.7 0.7 0.7translation='0 0 1'>
125                                               <!-- Axis for wheelsFront -->
126                                               <Shape>
127                                                    <Appearance USE='axis'/>
128                                                    <Cylinder radius='0.1'/>
129                                               </Shape>
130                                          </Transform>
131                                          <Transform rotation='1 0 0 1.57scale='0.7 0.7 0.7translation='0 0 0.75'>
132                                               <!-- Joint -->
133                                               <Shape>
134                                                    <Appearance USE='axis'/>
135                                                    <Cylinder height='0.4radius='0.15'/>
136                                               </Shape>
137                                          </Transform>
138                                          <Transform scale='0.7 0.7 0.7translation='0 1.5 0.75'>
139                                               <!-- main axle for front wheels -->
140                                               <Shape>
141 
                                                  <!-- Appearance mainAxle is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                                                  <Appearance DEF='mainAxle'>
142                                                         <Material diffuseColor='1.0 1.0 1.0'/>
143                                                    </Appearance>
144                                                    <Cylinder height='3radius='0.25'/>
145                                               </Shape>
146                                          </Transform>
147                                          <Transform rotation='0 0 -1 1.05scale='0.7 0.7 0.7translation='0.68 1.5 0.75'>
148                                               <!-- assistant axle for front wheels -->
149                                               <Shape>
150                                                    <Appearance USE='mainAxle'/>
151                                                    <Cylinder radius='0.2'/>
152                                               </Shape>
153                                          </Transform>
154                                          <Transform rotation='0 0 -1 1.05scale='0.7 0.7 0.7translation='1.8 2.15 0.75'>
155                                               <!-- assistant axle for front wheels -->
156                                               <Shape>
157                                                    <Appearance USE='mainAxle'/>
158                                                    <Cylinder radius='0.3'/>
159                                               </Shape>
160                                          </Transform>
161                                     </Transform>
162                                </Group>
163 
                              <!-- ROUTE information for GearUpDownScript node:  [from ClockAxleGearUpDown.fraction_changed to set_fraction ] [from clockStartTime to ClockAxleGearUpDown.set_startTime ] [from gearupOut to ClockAxleGearUpDown.set_enabled ] [from keyValue to GearUpDownInterpolator.set_keyValue ] -->
                              <Script DEF='GearUpDownScript'>
164                                     <field name='gearuptype='SFBoolaccessType='inputOnly'
                                    appinfo='eventIn: boolean true: wheels up false: wheels down'/>
165                                     <field name='gearupOuttype='SFBoolaccessType='outputOnly'/>
166                                     <field name='keyValuetype='MFRotationaccessType='outputOnly'/>
167                                     <field name='kV1type='SFRotationaccessType='initializeOnly'/>
168                                     <field name='kV2type='SFRotationaccessType='initializeOnly'/>
169                                     <field name='kV3type='SFRotationaccessType='initializeOnly'/>
170                                     <field name='set_fractiontype='SFFloataccessType='inputOnly'/>
171                                     <field name='animationStartTimetype='SFTimeaccessType='inputOnly'/>
172                                     <field name='clockStartTimetype='SFTimeaccessType='outputOnly'/>
173                                     <field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
174                                     <IS>
175                                          <connect nodeField='gearupprotoField='gearup'/>
176                                          <connect nodeField='animationStartTimeprotoField='animationStartTime'/>
177                                          <connect nodeField='gearupOutprotoField='gearupOut'/>
178                                          <connect nodeField='traceEnabledprotoField='traceEnabled'/>
179                                     </IS>
  <![CDATA[
              
ecmascript:

function gearup(value, timeStamp) {
  
 if (value == true)       //Gear UP
 {
      	tracePrint ('[GearUp] ' );
      	tracePrint ('value = ' + value);
      	gearupOut = true;    	
      
      	kV1 = new SFRotation (new SFVec3f (0, 0, 1), 0.0);  
     	kV2 = new SFRotation (new SFVec3f (0, 0, 1), 0.79);
      	kV3 = new SFRotation(new SFVec3f (0, 0, 1), 1.70);
      	keyValue = new MFRotation(kV1, kV2, kV3);  
      	//tracePrint ('[keyValue = ]' + keyValue);      
  
 }
 else        //Gear Down
 {
      	tracePrint ('[GearDown] ' );
      	tracePrint ('value = ' + value);
      	gearupOut = true;
     	
      	keyValue = new MFRotation(kV3, kV2, kV1);  
      	//tracePrint ('[keyValue = ]' + keyValue);             
 }
 
}

function set_fraction (value, timeStamp)
{
	//tracePrint('time fraction = ' + value);
}

function animationStartTime(value, timeStamp)
{	
	tracePrint('The Start Time is: ' + value);
	clockStartTime = value;
}

function tracePrint (outputString)
{
	if (traceEnabled) Browser.println ('[WheelsFrontPrototype] ' + outputString);
}

            
]]>
181                                </Script>
182                           </Transform>
183                           <Viewpoint description='Front Wheels Side View Point'/>
184                           <Viewpoint description='Front Wheels View Pointorientation='.2 -.97 .138 1.1899position='-3.1 -.1 2.3'/>
185 
                         <!-- ROUTE information for GearUpDownInterpolator node:  [from GearUpDownScript.keyValue to set_keyValue ] [from ClockAxleGearUpDown.fraction_changed to set_fraction ] [from value_changed to WheelsFrontAxleTransform.set_rotation ] -->
                         <OrientationInterpolator DEF='GearUpDownInterpolatorkey='0 0.5 1.0keyValue='0 0 1 0.0 0 0 1 0.79 0 0 1 1.70'/>
186 
                         <!-- ROUTE information for ClockAxleGearUpDown node:  [from GearUpDownScript.clockStartTime to set_startTime ] [from GearUpDownScript.gearupOut to set_enabled ] [from fraction_changed to GearUpDownInterpolator.set_fraction ] [from fraction_changed to GearUpDownScript.set_fraction ] -->
                         <TimeSensor DEF='ClockAxleGearUpDowncycleInterval='4'/>
187                           < ROUTE  fromNode='GearUpDownScript' fromField='clockStartTime' toNode='ClockAxleGearUpDown' toField='set_startTime'/>
188                           < ROUTE  fromNode='GearUpDownScript' fromField='gearupOut' toNode='ClockAxleGearUpDown' toField='set_enabled'/>
189                           < ROUTE  fromNode='GearUpDownScript' fromField='keyValue' toNode='GearUpDownInterpolator' toField='set_keyValue'/>
190                           < ROUTE  fromNode='ClockAxleGearUpDown' fromField='fraction_changed' toNode='GearUpDownInterpolator' toField='set_fraction'/>
191                           < ROUTE  fromNode='ClockAxleGearUpDown' fromField='fraction_changed' toNode='GearUpDownScript' toField='set_fraction'/>
192                           < ROUTE  fromNode='GearUpDownInterpolator' fromField='value_changed' toNode='WheelsFrontAxleTransform' toField='set_rotation'/>
193                      </Group>
194                 </ProtoBody>
195            </ProtoDeclare>
196            <!-- ============================= -->
197            <Background skyColor='0.7 0.7 0.7'/>
198            <Anchor description='WheelsFrontExampleparameter='"target=_blank"'   url=' "WheelsFrontExample.wrl" "../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontExample.wrl" "WheelsFrontExample.x3d" "../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontExample.x3d" '>
199                 <Shape>
200                      <Text string='"WheelsFrontPrototype" "is a prototype definition file" "" "To see an example scene" "click on this text and view" "WheelsFrontExample"'>
201                           <FontStyle justify='"MIDDLE" "MIDDLE"'/>
202                      </Text>
203                      <Appearance/>
204                 </Shape>
205            </Anchor>
206       </Scene>
207  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: axis, black, black1, Clock, ClockAxleGearUpDown, GearUpDownInterpolator, GearUpDownScript, Hub, inside_wheel, inside_wheel2, mainAxle, wheel, wheel2, WheelInterpolator, WheelsFrontAxleTransform, WheelTouchSensor, WheelTransform, white, white1

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2

Index for ProtoDeclare definition: WheelsFront
-->
X3D Tooltips element index: Anchor, Appearance, Background, connect, Cylinder, Extrusion, field, FontStyle, Group, head, Inline, IS, Material, meta, OrientationInterpolator, ProtoBody, ProtoDeclare, ProtoInterface, ROUTE, Scene, Script, Shape, Text, TimeSensor, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

Event Graph ROUTE Table entries with 9 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.

WheelTouchSensor
TouchSensor
isOver
SFBool

ROUTE
event to
(1)
Clock
TimeSensor
set_enabled
SFBool
then
 
 
 
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
WheelInterpolator
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
WheelInterpolator
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(3)
WheelTransform
Transform
set_rotation
SFRotation

line 198
Anchor
description='WheelsFrontExample' 
User-interaction hint for this node. 

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototypeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.x3d -->

<!-- Color-coding legend: X3D terminology <X3dNode  DEF='idNamefield='value'/> matches XML terminology <XmlElement  DEF='idNameattribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
    <ProtoDeclare name='ProtoName'> <field name='fieldName'/> </ProtoDeclare> -->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->