<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "https://www.web3d.org/specifications/x3d-3.2.dtd">
<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'>
  <head>
    <meta content='Gimbals.x3d' name='title'/>
    <meta content='Gimbals for user-driven roll pitch and yaw angle conversions, also shows conversion from X3D (VRML) to DIS coordinate system. Select and drag each copper-colored gimbal for a CylinderSensor to change a rotation angle, script code displays changed orientaion values. Model inspiration by Bob McGhee.' name='description'/>
    <meta content='Eric Bachmann and Don Brutzman' name='creator'/>
    <meta content='1996' name='created'/>
    <meta content='19 April 1999' name='finished'/>
    <meta content='Curtis Blais' name='translator'/>
    <meta content='27 January 2001' name='translated'/>
    <meta content='18 March 2026' name='modified'/>
    <meta content='GimbalsExampleX_ITE.png' name='Image'/>
    <meta content='GimbalsExampleF18.png' name='Image'/>
    <meta content='GimbalsExampleRocket.png' name='Image'/>
    <meta content='Note that axis orientations are aligned with X3D Geospatial conventions' name='hint'/>
    <meta content='Scene Authoring Hints: Coordinate Systems and Rotations https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#CoordinateSystems' name='reference'/>
    <meta content='original https://www.web3d.org/WorkingGroups/vrtp/demo/gimbals/DisCoordinateSystemGimbals.wrl' name='reference'/>
    <meta content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/Gimbals.x3d' name='identifier'/>
    <meta content='../license.html' name='license'/>
  </head>
  <Scene>
    <WorldInfo title='Gimbals.x3d'/>
    <Background groundAngle='1.309 1.570796' groundColor='0 0.3 1 0 0.3 1 0 0.3 1' skyAngle='1.309 1.571' skyColor='0 0.2 0.7 0 0.5 1 1 1 1'/>
    <DirectionalLight color='0.5 0.4 0.0' direction='1 -.5 1'/>
    <Group DEF='ViewpointGroup'>
      <!-- have default Viewpoints precede model viewpoints for consistent navigation -->
      <Viewpoint description='South to North' position='0 15 100'/>
      <Viewpoint description='East to West' orientation='0 1 0 1.57079' position='120 20 0'/>
      <Viewpoint description='North to South' orientation='0 1 0 -3.14159' position='0 20 -120'/>
      <Viewpoint description='West to East' orientation='0 1 0 -1.57079' position='-120 20 0'/>
      <Viewpoint description='Close Up' orientation='1 0 0 -.20136' position='0 30 50'/>
      <Transform DEF='fromNEtoSW' rotation='0 1 0 0.7854' translation='30 40 30'>
        <Viewpoint description='Northeast to SW' orientation='1 0 0 -0.45'/>
      </Transform>
      <Transform DEF='fromSWtoNE' rotation='0 1 0 -2.35619' translation='-25 5 -25'>
        <Viewpoint description='Southwest to NE' orientation='1 0 0 0.35'/>
      </Transform>
      <Transform rotation='-1 0 0 1.57' translation='0 150 0'>
        <Viewpoint description='Top Down' orientation='0 0 -1 1.57' position='0 0 0'/>
      </Transform>
    </Group>
    <Transform DEF='SunInDistance' translation='-250 125 -250'>
      <Shape>
        <Appearance>
          <Material DEF='SUN_MATERIAL' ambientIntensity='0' diffuseColor='1 0.871763 0' emissiveColor='1 0.871763 0' shininess='0.5' specularColor='1 1 1'/>
        </Appearance>
        <Sphere radius='5.0'/>
      </Shape>
    </Transform>
    <Transform DEF='GlobalCoordinateAxes' translation='0 20 0'>
      <Transform DEF='GlobalAxisLines'>
        <Shape>
          <Appearance>
            <Material DEF='COLOR1' diffuseColor='0.01 0.01 0.1' emissiveColor='0.01 0.01 0.1'/>
          </Appearance>
          <IndexedLineSet coordIndex='0 1 -1 2 3 -1 4 5 -1 6 7 -1 8 9 -1 10 11 -1'>
            <Coordinate point='35 0 0 2 0 0 -35 0 0 -2 0 0 0 25 0 0 2 0 0 -25 0 0 -2 0 0 0 35 0 0 2 0 0 -35 0 0 -2'/>
          </IndexedLineSet>
        </Shape>
      </Transform>
      <Transform DEF='PositiveZAxisLabel' translation='0 -4.0 40'>
        <Billboard axisOfRotation='0 0 0'>
          <Transform scale='0.1 0.1 0.1'>
            <Shape>
              <Appearance>
                <Material USE='COLOR1'/>
              </Appearance>
              <Text string='"South" "+Z X3D, -X DIS"'>
                <FontStyle DEF='FONT1' justify='"MIDDLE" "MIDDLE"' size='36'/>
              </Text>
            </Shape>
          </Transform>
        </Billboard>
      </Transform>
      <Transform DEF='PositiveXAxisLabel' translation='44 -4.0 0'>
        <Billboard axisOfRotation='0 0 0'>
          <Transform scale='0.1 0.1 0.1'>
            <Shape>
              <Appearance>
                <Material USE='COLOR1'/>
              </Appearance>
              <Text string='"East" "+X X3D, +Y DIS"'>
                <FontStyle USE='FONT1'/>
              </Text>
            </Shape>
          </Transform>
        </Billboard>
      </Transform>
      <Transform DEF='NegativeZAxisLabel' translation='-0.5 -4.0 -40'>
        <Billboard axisOfRotation='0 0 0'>
          <Transform scale='0.1 0.1 0.1'>
            <Shape>
              <Appearance>
                <Material USE='COLOR1'/>
              </Appearance>
              <Text string='"North" "-Z X3D, +X DIS"'>
                <FontStyle USE='FONT1'/>
              </Text>
            </Shape>
          </Transform>
        </Billboard>
      </Transform>
      <Transform DEF='NegativeXAxisLabel' translation='-44 -4.0 0'>
        <Billboard axisOfRotation='0 0 0'>
          <Transform scale='0.1 0.1 0.1'>
            <Shape>
              <Appearance>
                <Material USE='COLOR1'/>
              </Appearance>
              <Text string='"West" "-X X3D, -Y DIS"'>
                <FontStyle USE='FONT1'/>
              </Text>
            </Shape>
          </Transform>
        </Billboard>
      </Transform>
      <Transform DEF='PositiveYAxisLabel' translation='0 30 0'>
        <Billboard axisOfRotation='0 0 0'>
          <Transform scale='0.1 0.1 0.1'>
            <Shape>
              <Appearance>
                <Material USE='COLOR1'/>
              </Appearance>
              <Text string='"Up" "+Y X3D, -Z DIS"'>
                <FontStyle USE='FONT1'/>
              </Text>
            </Shape>
          </Transform>
        </Billboard>
      </Transform>
      <Transform DEF='NegativeYAxisLabel' translation='0 -28 0'>
        <Billboard axisOfRotation='0 0 0'>
          <Transform scale='0.1 0.1 0.1'>
            <Shape>
              <Appearance>
                <Material USE='COLOR1'/>
              </Appearance>
              <Text string='"Down" "-Y X3D, +Z DIS"'>
                <FontStyle USE='FONT1'/>
              </Text>
            </Shape>
          </Transform>
        </Billboard>
      </Transform>
    </Transform>
    <Transform DEF='GimbalObjects' rotation='0 1 0 1.57' translation='0 20 0'>
      <Transform DEF='AZIMUTH_TRANSFORM'>
        <CylinderSensor DEF='AZIMUTH_SENSOR' description='drag gimbal to change azimuth'/>
        <Transform DEF='AzimuthGimbal' rotation='1 0 0 1.57079'>
          <Transform DEF='AzimuthGimbalShape'>
            <Shape>
              <Appearance DEF='AppearanceGimbals'>
                <Material diffuseColor='1 0.59 0.3'/>
              </Appearance>
              <Extrusion beginCap='false' convex='false' creaseAngle='1.57' crossSection='0.5 0 0.46 -0.19 0.355 -0.355 0.19 -0.46 0 -0.5 -0.19 -0.46 -0.355 -0.355 -0.46 -0.19 -0.5 0 -0.46 0.19 -0.355 0.355 -0.19 0.46 0 0.5 0.19 0.46 0.355 0.355 0.46 0.19 0.5 0' endCap='false' solid='false' spine='14 0 0 13.25 0 7.85 11.05 0 11.05 7.85 0 13.25 0 0 14 -7.85 0 13.25 -11.05 0 11.05 -13.25 0 7.85 -14 0 0 -13.25 0 -7.85 -11.05 0 -11.05 -7.85 0 -13.25 0 0 -14 7.85 0 -13.25 11.05 0 -11.05 13.25 0 -7.85 14 0 0'/>
            </Shape>
            <Transform rotation='0 0 1 1.57079' translation='12.75 0 0'>
              <Shape DEF='PinShape'>
                <Appearance USE='AppearanceGimbals'/>
                <Cone bottomRadius='0.5' height='1.5'/>
              </Shape>
            </Transform>
            <Transform rotation='0 0 1 -1.57079' translation='-12.75 0 0'>
              <Shape USE='PinShape'/>
            </Transform>
          </Transform>
        </Transform>
        <Transform DEF='ElevationRollObjects' rotation='0 0 1 1.57'>
          <Transform DEF='ELEVATION_TRANSFORM'>
            <CylinderSensor DEF='ELEVATION_SENSOR' description='drag gimbal to change elevation'/>
            <Transform DEF='ElevationGimbal' rotation='0 0 1 1.57079'>
              <Transform DEF='ElevationGimbalShape'>
                <Shape>
                  <Appearance USE='AppearanceGimbals'/>
                  <Extrusion beginCap='false' convex='false' creaseAngle='1.57' crossSection='0.5 0 0.46 -0.19 0.355 -0.355 0.19 -0.46 0 -0.5 -0.19 -0.46 -0.355 -0.355 -0.46 -0.19 -0.5 0 -0.46 0.19 -0.355 0.355 -0.19 0.46 0 0.5 0.19 0.46 0.355 0.355 0.46 0.19 0.5 0' endCap='false' solid='false' spine='12 0 0 11.25 0 5.85 9.05 0 9.05 5.85 0 11.25 0 0 12 -5.85 0 11.25 -9.05 0 9.05 -11.25 0 5.85 -12 0 0 -11.25 0 -5.85 -9.05 0 -9.05 -5.85 0 -11.25 0 0 -12 5.85 0 -11.25 9.05 0 -9.05 11.25 0 -5.85 12 0 0'/>
                </Shape>
                <Transform rotation='1 0 0 -1.57079' translation='0 0 10.75'>
                  <Shape USE='PinShape'/>
                </Transform>
                <Transform rotation='1 0 0 1.57079' translation='0 0 -10.75'>
                  <Shape USE='PinShape'/>
                </Transform>
              </Transform>
            </Transform>
            <Transform DEF='RollObjects' rotation='1 0 0 -1.57'>
              <Transform DEF='ROLL_TRANSFORM'>
                <CylinderSensor DEF='ROLL_SENSOR' description='drag gimbal to change roll'/>
                <Transform DEF='RollGimbal' rotation='1 0 0 1.57079'>
                  <Transform DEF='RollGimbalShape'>
                    <Shape>
                      <Appearance USE='AppearanceGimbals'/>
                      <Extrusion beginCap='false' convex='false' creaseAngle='1.57' crossSection='0.5 0 0.46 -0.19 0.355 -0.355 0.19 -0.46 0 -0.5 -0.19 -0.46 -0.355 -0.355 -0.46 -0.19 -0.5 0 -0.46 0.19 -0.355 0.355 -0.19 0.46 0 0.5 0.19 0.46 0.355 0.355 0.46 0.19 0.5 0' endCap='false' solid='false' spine='10 0 0 9.25 0 3.85 7.05 0 7.05 3.85 0 9.25 0 0 10 -3.85 0 9.25 -7.05 0 7.05 -9.25 0 3.85 -10 0 0 -9.25 0 -3.85 -7.05 0 -7.05 -3.85 0 -9.25 0 0 -10 3.85 0 -9.25 7.05 0 -7.05 9.25 0 -3.85 10 0 0'/>
                    </Shape>
                  </Transform>
                  <Transform rotation='0 0 1 -1.57'>
                    <Transform rotation='0 1 0 -1.57' scale='0.4 0.4 0.4'>
                      <Transform DEF='ScaleUpContainedObject' scale='6 6 6'>
                        <!-- note that default is in a different library, so each Inline goes online for url retrieval if needed -->
                        <Switch DEF='ModelChoice' whichChoice='0'>
                          <Transform scale='0.4 0.4 0.4'>
                            <Inline DEF='F18Superhornet' url='"../../Savage/AircraftFixedWing/F18SuperhornetUnitedStates/F18.x3d" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18SuperhornetUnitedStates/F18.x3d" "../../Savage/AircraftFixedWing/F18SuperhornetUnitedStates/F18.wrl" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18SuperhornetUnitedStates/F18.wrl"'/>
                          </Transform>
                          <Inline DEF='ModelOrientation' url='"../course/ModelOrientation.x3d" "https://www.web3d.org/x3d/content/examples/Basic/course/ModelOrientation.x3d" "../course/ModelOrientation.wrl" "https://www.web3d.org/x3d/content/examples/Basic/course/ModelOrientation.wrl"'/>
                          <!-- you can add your model here -->
                        </Switch>
                      </Transform>
                      <Transform DEF='LocalCoordinateAxes' scale='0.65 0.65 0.65'>
                        <Transform DEF='LocalAxisLines'>
                          <Shape>
                            <Appearance DEF='AppearanceBodyAxes'>
                              <Material diffuseColor='1 .8 0' emissiveColor='1 .8 0'/>
                            </Appearance>
                            <IndexedLineSet coordIndex='0 1 -1 2 3 -1 4 5 -1'>
                              <Coordinate point='25 0 0 -25 0 0 0 25 0 0 -25 0 0 0 25 0 0 -25'/>
                            </IndexedLineSet>
                          </Shape>
                        </Transform>
                        <Transform DEF='PositiveXLocal' translation='35 0 0'>
                          <Billboard axisOfRotation='0 0 0'>
                            <Transform scale='.1 .1 .1'>
                              <Shape>
                                <Appearance USE='AppearanceBodyAxes'/>
                                <Text string='"body +X nose"'>
                                  <FontStyle DEF='FONT2' justify='"MIDDLE" "MIDDLE"' size='48'/>
                                </Text>
                              </Shape>
                            </Transform>
                          </Billboard>
                        </Transform>
                        <Transform DEF='NegativeXLocal' translation='-35 0 0'>
                          <Billboard axisOfRotation='0 0 0'>
                            <Transform scale='.1 .1 .1'>
                              <Shape>
                                <Appearance USE='AppearanceBodyAxes'/>
                                <Text string='"body -X tail"'>
                                  <FontStyle USE='FONT2'/>
                                </Text>
                              </Shape>
                            </Transform>
                          </Billboard>
                        </Transform>
                        <Transform DEF='PositiveZLocal' translation='0 -30 0'>
                          <Billboard axisOfRotation='0 0 0'>
                            <Transform scale='.1 .1 .1'>
                              <Shape>
                                <Appearance USE='AppearanceBodyAxes'/>
                                <Text string='"body -Y bottom"'>
                                  <FontStyle USE='FONT2'/>
                                </Text>
                              </Shape>
                            </Transform>
                          </Billboard>
                        </Transform>
                        <Transform DEF='NegativeZLocal' translation='0 26 0'>
                          <Billboard axisOfRotation='0 0 0'>
                            <Transform scale='.1 .1 .1'>
                              <Shape>
                                <Appearance USE='AppearanceBodyAxes'/>
                                <Text string='"body +Y top"'>
                                  <FontStyle USE='FONT2'/>
                                </Text>
                              </Shape>
                            </Transform>
                          </Billboard>
                        </Transform>
                        <Transform DEF='PositiveYLocal' translation='0 0 34'>
                          <Billboard axisOfRotation='0 0 0'>
                            <Transform scale='.1 .1 .1'>
                              <Shape>
                                <Appearance USE='AppearanceBodyAxes'/>
                                <Text string='"body +Z right"'>
                                  <FontStyle USE='FONT2'/>
                                </Text>
                              </Shape>
                            </Transform>
                          </Billboard>
                        </Transform>
                        <Transform DEF='NegativeYLocal' translation='0 0 -34'>
                          <Billboard axisOfRotation='0 0 0'>
                            <Transform scale='.1 .1 .1'>
                              <Shape>
                                <Appearance USE='AppearanceBodyAxes'/>
                                <Text string='"body -Z left"'>
                                  <FontStyle USE='FONT2'/>
                                </Text>
                              </Shape>
                            </Transform>
                          </Billboard>
                        </Transform>
                      </Transform>
                    </Transform>
                  </Transform>
                </Transform>
              </Transform>
            </Transform>
          </Transform>
        </Transform>
      </Transform>
    </Transform>
    <Transform DEF='RotationText' translation='0 -12 22'>
      <Billboard axisOfRotation='0 0 0'>
        <Shape>
          <Appearance>
            <Material diffuseColor='0 .8 .1' emissiveColor='0 .8 .1'/>
          </Appearance>
          <Text DEF='TRACE_STRING' string='"Drag gimbals for new rotation value"'>
            <FontStyle justify='"MIDDLE" "MIDDLE"' size='4'/>
          </Text>
        </Shape>
      </Billboard>
    </Transform>
    <Script DEF='CONSTRUCT_TRACE_STRING' url='"Gimbals.js" "https://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/Gimbals.js"'>
      <field accessType='initializeOnly' appinfo='declared for persistence' name='roll' type='SFFloat' value='0.0'/>
      <field accessType='initializeOnly' appinfo='declared for persistence' name='elevation' type='SFFloat' value='0.0'/>
      <field accessType='initializeOnly' appinfo='declared for persistence' name='azimuth' type='SFFloat' value='0.0'/>
      <field accessType='initializeOnly' appinfo='declared for persistence' name='azimuth2' type='SFFloat' value='0.0'/>
      <field accessType='inputOutput' appinfo='declared for persistence' name='newRotation' type='SFRotation' value='0 1 0 0'/>
      <field accessType='inputOutput' appinfo='declared for persistence' name='newRotationString' type='SFString'/>
      <field accessType='inputOnly' name='set_rollRotation' type='SFRotation'/>
      <field accessType='inputOnly' name='set_elevationRotation' type='SFRotation'/>
      <field accessType='inputOnly' name='set_azimuthRotation' type='SFRotation'/>
      <field accessType='outputOnly' name='rotationMessage_changed' type='MFString'/>
    </Script>
    <ROUTE fromField='rotation_changed' fromNode='ROLL_SENSOR' toField='set_rotation' toNode='ROLL_TRANSFORM'/>
    <ROUTE fromField='rotation_changed' fromNode='ELEVATION_SENSOR' toField='set_rotation' toNode='ELEVATION_TRANSFORM'/>
    <ROUTE fromField='rotation_changed' fromNode='AZIMUTH_SENSOR' toField='set_rotation' toNode='AZIMUTH_TRANSFORM'/>
    <ROUTE fromField='rotation_changed' fromNode='ROLL_SENSOR' toField='set_rollRotation' toNode='CONSTRUCT_TRACE_STRING'/>
    <ROUTE fromField='rotation_changed' fromNode='ELEVATION_SENSOR' toField='set_elevationRotation' toNode='CONSTRUCT_TRACE_STRING'/>
    <ROUTE fromField='rotation_changed' fromNode='AZIMUTH_SENSOR' toField='set_azimuthRotation' toNode='CONSTRUCT_TRACE_STRING'/>
    <ROUTE fromField='rotationMessage_changed' fromNode='CONSTRUCT_TRACE_STRING' toField='set_string' toNode='TRACE_STRING'/>
  </Scene>
</X3D>