X3D Model Documentation: RifleM24Example.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=' RifleM24Example.x3d '/>
  6            <meta name='descriptioncontent='Animation example from RifleM24 Prototype. Clicking trigger fires and sound.'/>
  7            <meta name='creatorcontent='Etsuko Lippi'/>
  8            <meta name='createdcontent='31 Decmember 2001'/>
  9            <meta name='modifiedcontent='28 November 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/Weapons/SmallArms/RifleM24Example.x3d '/>
 12            <meta name='subjectcontent='Rifle M24'/>
 13            <meta name='licensecontent='../../license.html'/>
 14       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: About, AboutRifleM24, FireScript, FireTouchSensor, rifleM24, Target

Index for ExternProtoDeclare definition: RifleM24
-->
 15       <Scene>
 16            <WorldInfo title='RifleM24Example.x3d'/>
 17            <ExternProtoDeclare name='RifleM24appinfo='Rifle M24'   url=' "RifleM24Prototype.x3d#RifleM24" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/SmallArms/RifleM24Prototype.x3d#RifleM24" "RifleM24Prototype.wrl#RifleM24" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/SmallArms/RifleM24Prototype.wrl#RifleM24" '>
 18                 <field name='triggertype='SFBoolaccessType='inputOnly'
                appinfo='input true to fire'/>
 19                 <field name='firetype='SFBoolaccessType='outputOnly'
                appinfo='output true when fired'/>
 20                 <field name='animationStartTimetype='SFTimeaccessType='inputOnly'
                appinfo='trigger animation'/>
 21            </ExternProtoDeclare>
 22            <Background skyColor='0.604 0.753 0.804'/>
 23            <Group>
 24 
               <!-- ROUTE information for rifleM24 node:  [from FireTouchSensor.touchTime to animationStartTime ] [from FireScript.fire to trigger ] -->
               <ProtoInstance name='RifleM24DEF='rifleM24'/>
 25 
               <!-- ROUTE information for FireScript node:  [from FireTouchSensor.isOver to enabled ] [from fire to rifleM24.trigger ] -->
               <Script DEF='FireScript'>
 26                      <field name='firetype='SFBoolaccessType='outputOnly'/>
 27                      <field name='enabledtype='SFBoolaccessType='inputOnly'/>
  <![CDATA[
        
ecmascript:

function enabled (value, timeStamp)
{
        //print ('enabled value =' + value);
        if (value == true)
           fire = value;
}

      
]]>
 29                 </Script>
 30 
               <!-- ROUTE information for FireTouchSensor node:  [from isOver to FireScript.enabled ] [from touchTime to rifleM24.animationStartTime ] -->
               <TouchSensor DEF='FireTouchSensordescription='click to shoot'/>
 31                 < ROUTE  fromNode='FireTouchSensor' fromField='isOver' toNode='FireScript' toField='enabled'/>
 32                 < ROUTE  fromNode='FireTouchSensor' fromField='touchTime' toNode='rifleM24' toField='animationStartTime'/>
 33                 < ROUTE  fromNode='FireScript' fromField='fire' toNode='rifleM24' toField='trigger'/>
 34            </Group>
 35            <Transform DEF='Targetrotation='0.58 0.58 0.58 2.09translation='50 -1 0'>
 36                 <Shape>
 37                      <Appearance>
 38                           <Material/>
 39                           <ImageTexture   url=' "Target.gif " "Target.jpg " "https://www.web3d.org/x3d/content/examples/Savage/Weapons/SmallArms/Target.gif " "https://www.web3d.org/x3d/content/examples/Savage/Weapons/SmallArms/Target.jpg " '/>
 40                      </Appearance>
 41                      <IndexedFaceSet creaseAngle='1.75solid='falsecoordIndex='0 1 2 3 0'>
 42                           <Coordinate point='0.00 1.30 0 2.5 1.30 0 2.5 -1.30 0 0.00 -1.30 0'/>
 43                      </IndexedFaceSet>
 44                 </Shape>
 45            </Transform>
 46            <Anchor DEF='Aboutdescription='Federation of American Scientists (FAS) pageparameter='"target=_blank"'   url=' "https://www.fas.org/man/dod-101/sys/land/m14.htm" '>
 47                 <Transform DEF='AboutRifleM24translation='-0.5 -0.4 -0.3'>
 48                      <Shape>
 49                           <Appearance>
 50                                <Material diffuseColor='0 0 0.545'/>
 51                           </Appearance>
 52                           <Text string='"About RifleM24"'>
 53                                <FontStyle justify='"MIDDLE" "MIDDLE"size='0.25style='BOLD'/>
 54                           </Text>
 55                      </Shape>
 56                 </Transform>
 57            </Anchor>
 58       </Scene>
 59  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: About, AboutRifleM24, FireScript, FireTouchSensor, rifleM24, Target

Index for ExternProtoDeclare definition: RifleM24
-->
X3D Tooltips element index: Anchor, Appearance, Background, Coordinate, ExternProtoDeclare, field, FontStyle, Group, head, ImageTexture, IndexedFaceSet, Material, meta, ProtoInstance, ROUTE, Scene, Script, Shape, Text, 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.

FireTouchSensor
TouchSensor
isOver
SFBool

ROUTE
event to
(1)
FireScript
Script
enabled
SFBool
then
 
 
 
FireScript
Script
fire
SFBool

ROUTE
event to
(2)
rifleM24
ProtoInstance
trigger
SFBool
FireTouchSensor
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
rifleM24
ProtoInstance
animationStartTime
SFTime

      rifleM24
ProtoInstance
RifleM24
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. 

About
Anchor
description='Federation of American Scientists (FAS) page' 
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/Weapons/SmallArms/RifleM24ExampleIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/Weapons/SmallArms/RifleM24Example.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. -->