X3D Model Documentation: MovingBody.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "https://www.web3d.org/specifications/x3d-3.2.dtd">
  3  <X3D profile='Immersive' version='3.2 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.2.xsd'>
  4       <head>
  5            <component level='2name='RigidBodyPhysics'/>
  6            <meta name='titlecontent='MovingBody.x3d'/>
  7            <meta name='descriptioncontent='Example scene for RigidBodyPhysics component'/>
  8            <meta name='creatorcontent='Alan Hudson and Justin Couch'/>
  9            <meta name='translatorcontent='Don Brutzman'/>
 10            <meta name='createdcontent='1 January 2008'/>
 11            <meta name='translatedcontent='26 December 2008'/>
 12            <meta name='modifiedcontent='4 February 2024'/>
 13            <meta name='referencecontent='http://www.xj3d.org/extensions/index.html#Physics'/>
 14            <meta name='referencecontent='originals/moving_body.x3dv'/>
 15            <meta name='referencecontent='https://www.web3d.org/x3d/specifications/ISO-IEC-FDIS-19775-1.2-X3D-AbstractSpecification/Part01/components/rigid_physics.html'/>
 16            <meta name=' warning content=' under development '/>
 17            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/MovingBody.x3d'/>
 18            <meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
 19            <meta name='generatorcontent='Xj3D converter, http://www.xj3d.org'/>
 20            <meta name='licensecontent='../../license.html'/>
 21       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: BODY-1, BODY-2, BODY-COLLECTION, COLLISION-GROUP, COLLISION-OUTPUT, PI, SPHERE-GEOM-1, SPHERE-GEOM-2, TS
-->
 22       <Scene>
 23            <WorldInfo title='MovingBody.x3d'/>
 24            <Group>
 25 
               <!-- CollidableShape SPHERE-GEOM-1 is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
               <CollidableShape DEF='SPHERE-GEOM-1containerField='children'>
 26                      <Shape containerField='shape'>
 27                           <Appearance>
 28                                <Material emissiveColor='1.0 0.0 0.0'/>
 29                           </Appearance>
 30                           <Sphere radius='0.2'/>
 31                      </Shape>
 32                 </CollidableShape>
 33 
               <!-- CollidableShape SPHERE-GEOM-2 is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
               <CollidableShape DEF='SPHERE-GEOM-2containerField='children'>
 34                      <Shape containerField='shape'>
 35                           <Appearance>
 36                                <Material emissiveColor='0.0 0.0 1.0'/>
 37                           </Appearance>
 38                           <Sphere radius='0.2'/>
 39                      </Shape>
 40                 </CollidableShape>
 41            </Group>
 42 
          <!-- ROUTE information for BODY-COLLECTION node:  [from COLLISION-OUTPUT.contacts to set_contacts ] -->
          <RigidBodyCollection DEF='BODY-COLLECTIONcontainerField='children'>
 43 
               <!-- ROUTE information for BODY-1 node:  [from PI.value_changed to position ] -->
               <RigidBody DEF='BODY-1containerField='bodieslinearVelocity='0.1 0.0 0.0mass='0.1position='-0.5 0.0 0.0'>
 44                      <CollidableShape USE='SPHERE-GEOM-1containerField='geometry'/>
 45                 </RigidBody>
 46                 <RigidBody DEF='BODY-2angularDampingFactor='0containerField='bodiesmass='0.1useGlobalGravity='false'>
 47                      <CollidableShape USE='SPHERE-GEOM-2containerField='geometry'/>
 48                 </RigidBody>
 49            </RigidBodyCollection>
 50 
          <!-- ROUTE information for COLLISION-OUTPUT node:  [from contacts to BODY-COLLECTION.set_contacts ] -->
          <CollisionSensor DEF='COLLISION-OUTPUT'>
 51                 <CollisionCollection DEF='COLLISION-GROUPbounce='1.0containerField='colliderminBounceSpeed='1.0'>
 52                      <CollidableShape USE='SPHERE-GEOM-1containerField='collidables'/>
 53                      <CollidableShape USE='SPHERE-GEOM-2containerField='collidables'/>
 54                 </CollisionCollection>
 55            </CollisionSensor>
 56 
          <!-- ROUTE information for TS node:  [from fraction_changed to PI.set_fraction ] -->
          <TimeSensor DEF='TScycleInterval='10.0loop='true'/>
 57 
          <!-- ROUTE information for PI node:  [from TS.fraction_changed to set_fraction ] [from value_changed to BODY-1.position ] -->
          <PositionInterpolator DEF='PIkey='0.0 0.25 0.5 0.75 1.0keyValue='-1.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 -1.0 0.0 -1.0 0.0 0.0'/>
 58            < ROUTE  fromNode='COLLISION-OUTPUT' fromField='contacts' toNode='BODY-COLLECTION' toField='set_contacts'/>
 59            < ROUTE  fromNode='TS' fromField='fraction_changed' toNode='PI' toField='set_fraction'/>
 60            < ROUTE  fromNode='PI' fromField='value_changed' toNode='BODY-1' toField='position'/>
 61       </Scene>
 62  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: BODY-1, BODY-2, BODY-COLLECTION, COLLISION-GROUP, COLLISION-OUTPUT, PI, SPHERE-GEOM-1, SPHERE-GEOM-2, TS
-->
X3D Tooltips element index: Appearance, CollidableShape, CollisionCollection, CollisionSensor, component, Group, head, Material, meta, PositionInterpolator, RigidBody, RigidBodyCollection, ROUTE, Scene, Shape, Sphere, TimeSensor, WorldInfo, X3D, accessType and type, XML data types, 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.

TS
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
PI
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
PI
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(2)
BODY-1
RigidBody
position
SFVec3f

COLLISION-OUTPUT
CollisionSensor
contacts
MFNode

ROUTE
event to
(1)
BODY-COLLECTION
RigidBodyCollection
set_contacts
MFNode
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/Basic/RigidBodyPhysics/MovingBodyIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/MovingBody.x3d -->

<!-- Color 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)
-->

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