X3D Model Documentation: WheelsFrontExample.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=' WheelsFrontExample.x3d '/>
  6            <meta name='descriptioncontent='An animation example of front wheels and axle Prototype. Clicking axle triggers animation for gear up or gear down of wheels and axle performance.'/>
  7            <meta name='creatorcontent='Etsuko Lippi'/>
  8            <meta name='createdcontent='11 July 2003'/>
  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/WheelsFrontExample.x3d '/>
 12            <meta name='subjectcontent='front wheels, gear-up and gear-down example'/>
 13            <meta name='licensecontent='../../license.html'/>
 14       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: ExampleSelectionScript, GearUpDown, GearUpDownTouchSensor, WP

Index for ExternProtoDeclare definition: WheelsFront
-->
 15       <Scene>
 16            <WorldInfo title='WheelsFrontExample.x3d'/>
 17            <ExternProtoDeclare name='WheelsFront'   url=' "WheelsFrontPrototype.x3d#WheelsFront" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.x3d#WheelsFront" "WheelsFrontPrototype.wrl#WheelsFront" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.wrl#WheelsFront" '>
 18                 <field name='gearuptype='SFBoolaccessType='inputOnly'/>
 19                 <field name='gearupOuttype='SFBoolaccessType='outputOnly'/>
 20                 <field name='animationStartTimetype='SFTimeaccessType='inputOnly'/>
 21                 <field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
 22            </ExternProtoDeclare>
 23            <Background skyColor='0.7 0.7 0.7'/>
 24            <Group>
 25                 <Transform DEF='GearUpDown'>
 26 
                    <!-- ROUTE information for ExampleSelectionScript node:  [from GearUpDownTouchSensor.isActive to enabled ] [from status to WP.gearup ] -->
                    <Script DEF='ExampleSelectionScript'>
 27                           <field name='landedtype='SFInt32value='-1accessType='initializeOnly'/>
 28                           <field name='enabledtype='SFBoolaccessType='inputOnly'/>
 29                           <field name='statustype='SFBoolaccessType='outputOnly'/>
  <![CDATA[
          
ecmascript:

function tracePrint (outputString)
{
	var traceEnabled = false;
	if (traceEnabled) Browser.println ('[trace] ' + outputString);
}

function enabled(value, timeStamp) {

	tracePrint('enabled = ' + value);
	if (value == true)
	{
		if (landed == -1)
		{			
                        status = false;
                        landed = 0;			
		}
                
		if (landed == 0)
		{
			if (status)
			{
				status = false;                               
			}
			else
			{
				status = true;                                			
			}
		}

                else
                {
         		landed = 0;
     			return;
                }
	}
	//print ('status = ' + status);
}

        
]]>
 31                      </Script>
 32                 </Transform>
 33 
               <!-- ROUTE information for GearUpDownTouchSensor node:  [from touchTime to WP.animationStartTime ] [from isActive to ExampleSelectionScript.enabled ] -->
               <TouchSensor DEF='GearUpDownTouchSensordescription='click for gears up/down'/>
 34 
               <!-- ROUTE information for WP node:  [from GearUpDownTouchSensor.touchTime to animationStartTime ] [from ExampleSelectionScript.status to gearup ] -->
               <ProtoInstance name='WheelsFrontDEF='WP'>
 35                      <fieldValue name='traceEnabledvalue='true'/>
 36                 </ProtoInstance>
 37            </Group>
 38            < ROUTE  fromNode='GearUpDownTouchSensor' fromField='touchTime' toNode='WP' toField='animationStartTime'/>
 39            < ROUTE  fromNode='GearUpDownTouchSensor' fromField='isActive' toNode='ExampleSelectionScript' toField='enabled'/>
 40            < ROUTE  fromNode='ExampleSelectionScript' fromField='status' toNode='WP' toField='gearup'/>
 41       </Scene>
 42  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: ExampleSelectionScript, GearUpDown, GearUpDownTouchSensor, WP

Index for ExternProtoDeclare definition: WheelsFront
-->
X3D Tooltips element index: Background, ExternProtoDeclare, field, fieldValue, Group, head, meta, ProtoInstance, ROUTE, Scene, Script, TouchSensor, Transform, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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

GearUpDownTouchSensor
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
WP
ProtoInstance
animationStartTime
SFTime
GearUpDownTouchSensor
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
ExampleSelectionScript
Script
enabled
SFBool
then
 
 
 
ExampleSelectionScript
Script
status
SFBool

ROUTE
event to
(2)
WP
ProtoInstance
gearup
SFBool

      WP
ProtoInstance
WheelsFront
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. 

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/WheelsFrontExampleIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontExample.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)
    <ProtoInstance name='ProtoName'> <field name='fieldName'/> </ProtoInstance> -->

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