X3D Model Documentation: SuperCobraPrototype.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
  3  <X3D profile='Immersive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  4       <head>
  5            <meta name='titlecontent=' SuperCobraPrototype.x3d '/>
  6            <meta name='descriptioncontent='Shows how to a prototype of Supercobra AH-1Z helicopter.'/>
  7            <meta name='creatorcontent='Don Brutzman'/>
  8            <meta name='createdcontent='16 January 2001'/>
  9            <meta name='modifiedcontent='1 December 2024'/>
 10            <meta name=' TODO content=' fix model rotations '/>
 11            <meta name='infocontent='Avoided recursive loading of SuperCobraPrototype.x3d model by placing the prototype in a separate file, rather than cirular referencing. Problem detected using castle-model-viewer.'/>
 12            <meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/Hughes500HoverInteriorMedium-cd21-no59-10sec.wav ' />
 13            <meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/FourBladeMainRotorPrototype.x3d '/>
 14            <meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/RocketPod.x3d '/>
 15            <meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SkidLeft.x3d '/>
 16            <meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SkidRight.x3d '/>
 17            <meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/TwoBladeTailRotorPrototype.x3d '/>
 18            <meta name='referencecontent=' https://www.fas.org/man/dod-101/sys/ac/ah-1.htm '/>
 19            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SuperCobraPrototype.x3d '/>
 20            <meta name='generatorcontent='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 21            <meta name='licensecontent='../../license.html'/>
 22       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: EXAMPLE_SELECTION, EXAMPLE_SWITCH, MATERIAL_Camouflage, MATERIAL_Green, MATERIAL_Grey, TOUCH_Camouflage, TOUCH_Green, TOUCH_Grey, TransparentMaterial

Index for Viewpoint node: Viewpoint_1

Index for ExternProtoDeclare definition: SuperCobra
-->
 23       <Scene>
 24            <ExternProtoDeclare name='SuperCobraappinfo='Prototype declaration for SuperCobra helicopter'   url=' "SuperCobraPrototype.x3d#SuperCobra" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SuperCobraPrototype.x3d#SuperCobra" "SuperCobraPrototype.wrl#SuperCobra" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SuperCobraPrototype.wrl#SuperCobra" '/>
 25            <!-- ================================================================================================================ -->
 26            <!-- Example Helicopters -->
 27            <Background skyColor='.4 .4 .6'/>
 28            <Viewpoint description='Select Helicopterorientation='0 1 0 1.57position='14 3.2 0'/>
 29            <Transform translation='0 6.5 0'>
 30                 <Billboard>
 31                      <Shape>
 32                           <Appearance>
 33                                <Material diffuseColor='0.9 0.9 0.2'/>
 34                           </Appearance>
 35                           <Text string='"Select SuperCobra Paint Scheme"'>
 36                                <FontStyle justify='"MIDDLE" "MIDDLE"'/>
 37                           </Text>
 38                      </Shape>
 39                      <Transform translation='0 -1.5 0'>
 40                           <Transform translation='-6 0 0'>
 41 
                              <!-- ROUTE information for TOUCH_Green node:  [from isActive to EXAMPLE_SELECTION.touchedGreen ] -->
                              <TouchSensor DEF='TOUCH_Greendescription='touch for green material'/>
 42                                <Shape>
 43                                     <Appearance>
 44 
                                        <!-- ROUTE information for MATERIAL_Green node:  [from EXAMPLE_SELECTION.greenSelectionColor to diffuseColor ] -->
                                        <Material DEF='MATERIAL_GreendiffuseColor='0 0.8 0'/>
 45                                     </Appearance>
 46                                     <Text string='"Green"'>
 47                                          <FontStyle justify='"MIDDLE" "MIDDLE"'/>
 48                                     </Text>
 49                                </Shape>
 50                                <Shape>
 51                                     <Box size='3.5 1 .01'/>
 52 
                                   <!-- Appearance TransparentMaterial is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                                   <Appearance DEF='TransparentMaterial'>
 53                                          <Material transparency='1'/>
 54                                     </Appearance>
 55                                </Shape>
 56                           </Transform>
 57                           <Transform>
 58 
                              <!-- ROUTE information for TOUCH_Camouflage node:  [from isActive to EXAMPLE_SELECTION.touchedCamouflage ] -->
                              <TouchSensor DEF='TOUCH_Camouflagedescription='touch for camoflage material'/>
 59                                <Shape>
 60                                     <Appearance>
 61 
                                        <!-- ROUTE information for MATERIAL_Camouflage node:  [from EXAMPLE_SELECTION.camouflageSelectionColor to diffuseColor ] -->
                                        <Material DEF='MATERIAL_CamouflagediffuseColor='0.7 0.7 0'/>
 62                                     </Appearance>
 63                                     <Text string='"Camouflage"'>
 64                                          <FontStyle justify='"MIDDLE" "MIDDLE"'/>
 65                                     </Text>
 66                                </Shape>
 67                                <Shape>
 68                                     <Box size='7 1 .01'/>
 69                                     <Appearance USE='TransparentMaterial'/>
 70                                </Shape>
 71                           </Transform>
 72                           <Transform translation='6 0 0'>
 73 
                              <!-- ROUTE information for TOUCH_Grey node:  [from isActive to EXAMPLE_SELECTION.touchedGrey ] -->
                              <TouchSensor DEF='TOUCH_Greydescription='touch for grey material'/>
 74                                <Shape>
 75                                     <Appearance>
 76 
                                        <!-- ROUTE information for MATERIAL_Grey node:  [from EXAMPLE_SELECTION.greySelectionColor to diffuseColor ] -->
                                        <Material DEF='MATERIAL_Grey'/>
 77                                     </Appearance>
 78                                     <Text string='"Grey"'>
 79                                          <FontStyle justify='"MIDDLE" "MIDDLE"'/>
 80                                     </Text>
 81                                </Shape>
 82                                <Shape>
 83                                     <Box size='3 1 0.01'/>
 84                                     <Appearance USE='TransparentMaterial'/>
 85                                </Shape>
 86                           </Transform>
 87                      </Transform>
 88                 </Billboard>
 89            </Transform>
 90 
          <!-- ROUTE information for EXAMPLE_SWITCH node:  [from EXAMPLE_SELECTION.selection to whichChoice ] -->
          <Switch DEF='EXAMPLE_SWITCHwhichChoice='0'>
 91                 <Transform rotation='0 1 0 1.57'>
 92                      <Inline   url=' "ExampleGreenCobra.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleGreenCobra.x3d" "ExampleGreenCobra.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleGreenCobra.wrl" '/>
 93                 </Transform>
 94                 <Transform rotation='0 1 0 1.57'>
 95                      <Inline   url=' "ExampleCamouflageCobra.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleCamouflageCobra.x3d" "ExampleCamouflageCobra.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleCamouflageCobra.wrl" '/>
 96                 </Transform>
 97                 <Transform rotation='0 1 0 1.57'>
 98                      <Inline   url=' "ExampleGreyCobra.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleGreyCobra.x3d" "ExampleGreyCobra.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/ExampleGreyCobra.wrl" '/>
 99                 </Transform>
100            </Switch>
101 
102                 <field name='touchedGreentype='SFBoolaccessType='inputOnly'/>
103                 <field name='touchedCamouflagetype='SFBoolaccessType='inputOnly'/>
104                 <field name='touchedGreytype='SFBoolaccessType='inputOnly'/>
105                 <field name='selectiontype='SFInt32accessType='outputOnly'/>
106                 <field name='greenSelectionColortype='SFColoraccessType='outputOnly'/>
107                 <field name='camouflageSelectionColortype='SFColoraccessType='outputOnly'/>
108                 <field name='greySelectionColortype='SFColoraccessType='outputOnly'/>
  <![CDATA[
      
ecmascript:  

function touchedGreen(value, ts) 
{
	selection = 0;
	greenSelectionColor = new SFColor(0, 0.8, 0);
	camouflageSelectionColor = new SFColor(0.8, 0, 0);
	greySelectionColor = new SFColor(0.8, 0, 0);
}
function touchedCamouflage(value, ts) 
{
	selection = 1;
	greenSelectionColor = new SFColor(0.8, 0, 0);
	camouflageSelectionColor = new SFColor(0, 0.8, 0);
	greySelectionColor = new SFColor(0.8, 0, 0);
}
function touchedGrey(value, ts) 
{
	selection = 2;
	greenSelectionColor = new SFColor(0.8, 0, 0);
	camouflageSelectionColor = new SFColor(0.8, 0, 0);
	greySelectionColor = new SFColor(0, 0.8, 0);
}

    
]]>
110            </Script>
111            < ROUTE  fromNode='TOUCH_Green' fromField='isActive' toNode='EXAMPLE_SELECTION' toField='touchedGreen'/>
112            < ROUTE  fromNode='TOUCH_Camouflage' fromField='isActive' toNode='EXAMPLE_SELECTION' toField='touchedCamouflage'/>
113            < ROUTE  fromNode='TOUCH_Grey' fromField='isActive' toNode='EXAMPLE_SELECTION' toField='touchedGrey'/>
114            < ROUTE  fromNode='EXAMPLE_SELECTION' fromField='greenSelectionColor' toNode='MATERIAL_Green' toField='diffuseColor'/>
115            < ROUTE  fromNode='EXAMPLE_SELECTION' fromField='camouflageSelectionColor' toNode='MATERIAL_Camouflage' toField='diffuseColor'/>
116            < ROUTE  fromNode='EXAMPLE_SELECTION' fromField='greySelectionColor' toNode='MATERIAL_Grey' toField='diffuseColor'/>
117            < ROUTE  fromNode='EXAMPLE_SELECTION' fromField='selection' toNode='EXAMPLE_SWITCH' toField='whichChoice'/>
118       </Scene>
119  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: EXAMPLE_SELECTION, EXAMPLE_SWITCH, MATERIAL_Camouflage, MATERIAL_Green, MATERIAL_Grey, TOUCH_Camouflage, TOUCH_Green, TOUCH_Grey, TransparentMaterial

Index for Viewpoint node: Viewpoint_1

Index for ExternProtoDeclare definition: SuperCobra
-->
X3D Tooltips element index: Appearance, Background, Billboard, Box, ExternProtoDeclare, field, FontStyle, head, Inline, Material, meta, ROUTE, Scene, Script, Shape, Switch, Text, TouchSensor, Transform, Viewpoint, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

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

TOUCH_Camouflage
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
EXAMPLE_SELECTION
Script
touchedCamouflage
SFBool
then
 
 
 
EXAMPLE_SELECTION
Script
camouflageSelectionColor
SFColor

ROUTE
event to
(2)
MATERIAL_Camouflage
Material
diffuseColor
SFColor
  then
 
 
 
EXAMPLE_SELECTION
Script
greenSelectionColor
SFColor

ROUTE
event to
(2)
MATERIAL_Green
Material
diffuseColor
SFColor
  then
 
 
 
EXAMPLE_SELECTION
Script
greySelectionColor
SFColor

ROUTE
event to
(2)
MATERIAL_Grey
Material
diffuseColor
SFColor
  then
 
 
 
EXAMPLE_SELECTION
Script
selection
SFInt32

ROUTE
event to
(2)
EXAMPLE_SWITCH
Switch
whichChoice
SFInt32

TOUCH_Green
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
EXAMPLE_SELECTION
Script
touchedGreen
SFBool
then
 
 
 
EXAMPLE_SELECTION
Script
camouflageSelectionColor
SFColor

ROUTE
event to
(2)
MATERIAL_Camouflage
Material
diffuseColor
SFColor
  then
 
 
 
EXAMPLE_SELECTION
Script
greenSelectionColor
SFColor

ROUTE
event to
(2)
MATERIAL_Green
Material
diffuseColor
SFColor
  then
 
 
 
EXAMPLE_SELECTION
Script
greySelectionColor
SFColor

ROUTE
event to
(2)
MATERIAL_Grey
Material
diffuseColor
SFColor
  then
 
 
 
EXAMPLE_SELECTION
Script
selection
SFInt32

ROUTE
event to
(2)
EXAMPLE_SWITCH
Switch
whichChoice
SFInt32

TOUCH_Grey
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
EXAMPLE_SELECTION
Script
touchedGrey
SFBool
then
 
 
 
EXAMPLE_SELECTION
Script
camouflageSelectionColor
SFColor

ROUTE
event to
(2)
MATERIAL_Camouflage
Material
diffuseColor
SFColor
  then
 
 
 
EXAMPLE_SELECTION
Script
greenSelectionColor
SFColor

ROUTE
event to
(2)
MATERIAL_Green
Material
diffuseColor
SFColor
  then
 
 
 
EXAMPLE_SELECTION
Script
greySelectionColor
SFColor

ROUTE
event to
(2)
MATERIAL_Grey
Material
diffuseColor
SFColor
  then
 
 
 
EXAMPLE_SELECTION
Script
selection
SFInt32

ROUTE
event to
(2)
EXAMPLE_SWITCH
Switch
whichChoice
SFInt32


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/AircraftHelicopters/AH1SuperCobraUnitedStates/SuperCobraPrototypeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/SuperCobraPrototype.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. -->