<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.1//EN" "https://www.web3d.org/specifications/x3d-4.1.dtd">
<X3D profile='Full' version='4.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.1.xsd'>
  <head>
    <meta content='HAnimPoseExample.x3d' name='title'/>
    <meta content='Native XML definition of an experimental new node to simply capture a single pose for an HAnimHumanoid model. Expected usage is to allow HAnimHumanoid to contain multiple Pose nodes which can be activated and composed.' name='description'/>
    <meta content='11 December 2025' name='created'/>
    <meta content='19 July 2026' name='modified'/>
    <meta content='Don Brutzman' name='creator'/>
    <meta content='under development for X3D 4.1' name='warning'/>
    <meta content='HAnim Architecture volume 1 version 2.1 draft, clause 6 Object interfaces, section 6.4 Pose' name='specificationSection'/>
    <meta content='https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19774/ISO-IEC19774-1/ISO-IEC19774-1v2.1/ISO-IEC19774-1v2.1-WD/Architecture/ObjectInterfaces.html#Pose' name='specificationUrl'/>
    <meta content='HAnim Architecture volume 1 version 2.1 draft, clause 4 Concepts, section 4.8.2 Modelling of human-like HAnim figures' name='specificationSection'/>
    <meta content='https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19774/ISO-IEC19774-1/ISO-IEC19774-1v2.1/ISO-IEC19774-1v2.1-WD/Architecture/concepts.html#ModellingHumanLikeHAnimFigures' name='specificationUrl'/>
    <meta content='HAnim Architecture volume 1 version 2.1 draft, clause 4 Concepts, section 4.8.3 Poses' name='specificationSection'/>
    <meta content='https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19774/ISO-IEC19774-1/ISO-IEC19774-1v2.1/ISO-IEC19774-1v2.1-WD/Architecture/concepts.html#Poses' name='specificationUrl'/>
    <meta content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Poses/HAnimPoseExample.x3d' name='identifier'/>
    <meta content='https://www.web3d.org/x3d/content/examples/license.html' name='license'/>
  </head>
  <Scene>
    <WorldInfo DEF='ModelInfo' info='"Example scene for HAnimPose node"' title='HAnimPoseExample.x3d'/>
    <Background skyColor='0.8 0.8 1'/>
    <NavigationInfo/>
    <Group DEF='HandleInlineLoading'>
      <!-- Multiple HAnimHumanoid Inline/IMPORT models are available to support testing: Characters/ JinLOA1 JinLOA2 JinLOA3 JinLOA4 ../Skin/JoeKick ../Skin/JoeSkeletonSkinSite ../Skin/BoxMan1 ../Skin/BoxMan2 -->
      <!-- Also tested satisfactorily: KoreanCharacter01Jin KoreanCharacter02Chul KoreanCharacter03Hyun KoreanCharacter04Young KoreanCharacter05Ju KoreanCharacter06Ga KoreanCharacter07No KoreanCharacter08Da KoreanCharacter09Ru KoreanCharacter10Mi KoreanCharacter11Min KoreanCharacter12Sun -->
      <Inline DEF='HumanoidInline' description='remote HAnimHumanoid for IMPORT' url='"../Skin/JoeSkeletonSkinSite.x3d" "https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skin/JoeSkeletonSkinSite.x3d"' visible='true'/>
      <!-- Note that the following importedDEF must match the EXPORT name found in remote file -->
      <IMPORT AS='HumanoidImported' importedDEF='JoeSkeletonSkinSite' inlineDEF='HumanoidInline'/>
      <LoadSensor DEF='HumanoidInlineLoadSensor' timeOut='2'>
        <Inline USE='HumanoidInline'/>
      </LoadSensor>
    </Group>
    <Viewpoint description='HAnimPose for HumanoidInline IMPORT model' position='0 1 4'/>
    <!-- no longer required: including full model <HAnimHumanoid DEF='hanim_JinLOA1' loa='2' name='JinLOA1' scale='0.0225 0.0225 0.0225'> etc... -->
    <HAnimPose DEF='T_Pose' description='arms stretched outward and level similar to letter T' enabled='true' loa='1' name='T' transitionDuration='1.3'>
      <MetadataString containerField='metadata' name='metadataTest' value='"hello HAnimPose metadata"'/>
      <!-- test case for illegal child triggers validation reports without problem: HAnimSegment DEF='TestCase' description='confirm type checking' name='specialTestCase'/ -->
      <HAnimJoint DEF='PoseJoint_l_shoulder_1' description='left shoulder' name='l_shoulder' rotation='0 0 1 1.57'/>
      <HAnimJoint DEF='PoseJoint_r_shoulder_1' description='right shoulder' name='r_shoulder' rotation='0 0 -1 1.57'/>
    </HAnimPose>
    <HAnimPose DEF='A_Pose' description='arms stretched outward and downward similar to letter A' enabled='true' loa='1' name='A' transitionDuration='1.2'>
      <HAnimJoint DEF='PoseJoint_l_shoulder' description='left shoulder' name='l_shoulder' rotation='0 0 1 0.5'/>
      <HAnimJoint DEF='PoseJoint_r_shoulder' description='right shoulder' name='r_shoulder' rotation='0 0 -1 0.5'/>
    </HAnimPose>
    <HAnimPose DEF='TouchDown_Pose' description='arms and legs stretched outward providing a TouchDown gesture' enabled='true' loa='1' name='TouchDown' transitionDuration='1.2'>
      <HAnimJoint name='humanoid_root' rotation='0 1 0 -0.698132'/>
      <HAnimJoint name='l_hip' rotation='-1 1 1 1'/>
      <HAnimJoint name='l_knee' rotation='1 0 0 1'/>
      <HAnimJoint name='l_talocrural' rotation='-0.2 -0 0.1 0.225'/>
      <HAnimJoint name='r_hip' rotation='-1 -1 -1 1'/>
      <HAnimJoint name='r_knee' rotation='1 0 0 1'/>
      <HAnimJoint name='r_talocrural' rotation='-0.2 0 0.1 0.25'/>
      <HAnimJoint name='vl5' rotation='0 0 0.01 0.2'/>
      <HAnimJoint name='vt10' rotation='0 0 0.01 0.1'/>
      <HAnimJoint name='vc4' rotation='0 0 -0.01 0.15'/>
      <HAnimJoint name='l_shoulder' rotation='-1 0.5 1 2'/>
      <HAnimJoint name='l_elbow' rotation='-1 0 0 1'/>
      <HAnimJoint name='l_radiocarpal' rotation='0 0 1 0'/>
      <HAnimJoint name='r_shoulder' rotation='-1 -0.5 -1 2.6'/>
      <HAnimJoint name='r_elbow' rotation='-1 0 0 1'/>
      <HAnimJoint name='r_radiocarpal' rotation='0 0 1 0'/>
    </HAnimPose>
    <HAnimPose DEF='I_Pose' description='arms and legs straight down default binding pose for baseline Humanoid' enabled='true' loa='1' name='I' transitionDuration='1.5'>
      <!-- not defining any poseJoint HAnimJoint nodes equals the default "I" pose -->
    </HAnimPose>
    <HAnimPose DEF='H_Pose' description='TODO experimental pose not yet implemented' enabled='false' name='H' transitionDuration='1.4'>
      <!-- TODO define poseJoint HAnimJoint nodes -->
    </HAnimPose>
    <HAnimPose DEF='FaceLeft_Pose' description='Only modify humanoid_root Joint node to face left' enabled='true' loa='0' name='FaceLeft' transitionDuration='1.1'>
      <HAnimJoint DEF='FaceLeft_humanoid_root' description='Only rotate the model' name='humanoid_root' rotation='0 1 0 1.570796'/>
    </HAnimPose>
    <HAnimPose DEF='FaceRight_Pose' description='Only modify humanoid_root Joint node to face right' enabled='true' loa='0' name='FaceRight' transitionDuration='1.1'>
      <HAnimJoint DEF='FaceRight_humanoid_root' description='Only rotate the model' name='humanoid_root' rotation='0 1 0 -1.570796'/>
    </HAnimPose>
    <Group DEF='InterfaceButtonsGroup'>
      <Transform DEF='DisplayHeader' translation='0 2 0'>
        <Shape>
          <Text string='"HAnimPosePrototype example implementation"'>
            <FontStyle DEF='HeaderFont' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.15' style='BOLD'/>
          </Text>
          <Appearance DEF='PoseTextAppearance'>
            <Material diffuseColor='0.1 0.5 0.3'/>
          </Appearance>
        </Shape>
      </Transform>
      <Transform DEF='T_PoseInterface' translation='-1.5 1.5 0'>
        <Shape>
          <Text string='"\"T\" Pose"'>
            <FontStyle DEF='SharedFont' family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.1' style='BOLD'/>
          </Text>
          <Appearance USE='PoseTextAppearance'/>
        </Shape>
        <Shape>
          <Appearance DEF='TransparentAppearance'>
            <Material transparency='0.8'/>
          </Appearance>
          <Box size='0.45 0.2 0.001'/>
        </Shape>
        <TouchSensor DEF='T_PoseTouchSensor' description='select to move shoulders to "T" pose, leave other joints unchanged'/>
        <ROUTE fromField='isActive' fromNode='T_PoseTouchSensor' toField='commencePose' toNode='T_Pose'/>
      </Transform>
      <Transform DEF='A_PoseInterface' translation='-1.5 1 0'>
        <Shape>
          <Text string='"\"A\" Pose"'>
            <FontStyle USE='SharedFont'/>
          </Text>
          <Appearance USE='PoseTextAppearance'/>
        </Shape>
        <Shape>
          <!-- Selectable Text transparent Box for easy user selection -->
          <Appearance USE='TransparentAppearance'/>
          <Box size='0.45 0.2 0.001'/>
        </Shape>
        <TouchSensor DEF='A_PoseTouchSensor' description='select to move shoulders to "A" pose, leave other joints unchanged'/>
        <ROUTE fromField='isActive' fromNode='A_PoseTouchSensor' toField='commencePose' toNode='A_Pose'/>
      </Transform>
      <Transform DEF='TouchDown_PoseInterface' translation='-1.5 0.5 0'>
        <Shape>
          <Text string='"TouchDown Pose"'>
            <FontStyle USE='SharedFont'/>
          </Text>
          <Appearance USE='PoseTextAppearance'/>
        </Shape>
        <Shape>
          <!-- Selectable Text transparent Box for easy user selection -->
          <Appearance USE='TransparentAppearance'/>
          <Box size='0.85 0.2 0.001'/>
        </Shape>
        <TouchSensor DEF='TouchDown_PoseTouchSensor' description='select to transition all joints to TouchDown pose'/>
        <ROUTE fromField='isActive' fromNode='TouchDown_PoseTouchSensor' toField='commencePose' toNode='TouchDown_Pose'/>
      </Transform>
      <Transform DEF='I_PoseInterface' translation='-1.5 0.0 0'>
        <Shape>
          <Text string='"\"I\" Pose"'>
            <FontStyle USE='SharedFont'/>
          </Text>
          <Appearance USE='PoseTextAppearance'/>
        </Shape>
        <Shape>
          <!-- Selectable Text transparent Box for easy user selection -->
          <Appearance USE='TransparentAppearance'/>
          <Box size='0.45 0.2 0.001'/>
        </Shape>
        <TouchSensor DEF='I_PoseTouchSensor' description='select to transition all joints to "I" pose'/>
        <ROUTE fromField='isActive' fromNode='I_PoseTouchSensor' toField='commencePose' toNode='I_Pose'/>
      </Transform>
      <Transform DEF='FaceLeftPoseInterface' translation='1.5 1.5 0'>
        <Shape>
          <Text string='"Face Left Pose"'>
            <FontStyle USE='SharedFont'/>
          </Text>
          <Appearance USE='PoseTextAppearance'/>
        </Shape>
        <Shape>
          <Appearance USE='TransparentAppearance'/>
          <Box size='0.9 0.2 0.001'/>
        </Shape>
        <TouchSensor DEF='FaceLeftTouchSensor' description='select to rotate body and Face Left, leave other joints unchanged'/>
        <ROUTE fromField='isActive' fromNode='FaceLeftTouchSensor' toField='commencePose' toNode='FaceLeft_Pose'/>
      </Transform>
      <Transform DEF='FaceRightPoseInterface' translation='1.5 1 0'>
        <Shape>
          <Text string='"Face Right Pose"'>
            <FontStyle USE='SharedFont'/>
          </Text>
          <Appearance USE='PoseTextAppearance'/>
        </Shape>
        <Shape>
          <!-- Selectable Text transparent Box for easy user selection -->
          <Appearance USE='TransparentAppearance'/>
          <Box size='0.9 0.2 0.001'/>
        </Shape>
        <TouchSensor DEF='FaceRightTouchSensor' description='select to rotate body and Face Right, leave other joints unchanged'/>
        <ROUTE fromField='isActive' fromNode='FaceRightTouchSensor' toField='commencePose' toNode='FaceRight_Pose'/>
      </Transform>
      <Transform DEF='AnimatePosesInterface' translation='1.5 0.5 0'>
        <Shape>
          <Text string='"Direct animation" "to, from \"I\" Pose"'>
            <FontStyle USE='SharedFont'/>
          </Text>
          <Appearance DEF='AnimationTextAppearance'>
            <Material diffuseColor='0.1 0.2 0.3'/>
          </Appearance>
        </Shape>
        <Shape>
          <!-- Selectable Text transparent Box for easy user selection -->
          <Appearance USE='TransparentAppearance'/>
          <Box size='0.9 0.25 0.001'/>
        </Shape>
        <TouchSensor DEF='AnimatePosesTouchSensor' description='select to animate current pose to "I" pose, then back to original pose, using TimeSensor events'/>
        <!-- cycleInterval=4 also hard-coded in script execution message -->
        <TimeSensor DEF='AnimatePosesClock' cycleInterval='4' description='directly animate several poses'/>
        <ScalarInterpolator DEF='AnimatePosesLoopInterpolator' key='0 0.05 0.45 0.55 0.95 1' keyValue='0 0 1 1 0 0'/>
        <ROUTE fromField='touchTime' fromNode='AnimatePosesTouchSensor' toField='startTime' toNode='AnimatePosesClock'/>
        <ROUTE fromField='fraction_changed' fromNode='AnimatePosesClock' toField='set_fraction' toNode='AnimatePosesLoopInterpolator'/>
        <ROUTE fromField='value_changed' fromNode='AnimatePosesLoopInterpolator' toField='set_fraction' toNode='I_Pose'/>
      </Transform>
      <Transform DEF='ResetDefaultPoseInterface' translation='1.5 0.0 0'>
        <Shape>
          <Text string='"Reset All Joints" "to Default \"I\" Pose"'>
            <FontStyle USE='SharedFont'/>
          </Text>
          <Appearance USE='AnimationTextAppearance'/>
        </Shape>
        <Shape>
          <!-- Selectable Text transparent Box for easy user selection -->
          <Appearance USE='TransparentAppearance'/>
          <Box size='0.9 0.25 0.001'/>
        </Shape>
        <TouchSensor DEF='ResetPoseTouchSensor' description='select to immediately Rezero All Joints (to default "I" Pose) by sending resetAllJoints event'/>
        <ROUTE fromField='isActive' fromNode='ResetPoseTouchSensor' toField='resetAllJoints' toNode='FaceLeft_Pose'/>
      </Transform>
    </Group>
    <!-- not needed for native node implementation <Group DEF='HandleInlineLoadsensorRouting'> <ROUTE fromField='isLoaded' fromNode='HumanoidInlineLoadSensor' toField='commencePose' toNode='A_Pose'/> <ROUTE fromField='isLoaded' fromNode='HumanoidInlineLoadSensor' toField='commencePose' toNode='H_Pose'/> <ROUTE fromField='isLoaded' fromNode='HumanoidInlineLoadSensor' toField='commencePose' toNode='I_Pose'/> <ROUTE fromField='isLoaded' fromNode='HumanoidInlineLoadSensor' toField='commencePose' toNode='T_Pose'/> <ROUTE fromField='isLoaded' fromNode='HumanoidInlineLoadSensor' toField='commencePose' toNode='FaceLeft_Pose'/> <ROUTE fromField='isLoaded' fromNode='HumanoidInlineLoadSensor' toField='commencePose' toNode='FaceRight_Pose'/> <ROUTE fromField='isLoaded' fromNode='HumanoidInlineLoadSensor' toField='commencePose' toNode='TouchDown_Pose'/> </Group> -->
    <HAnimHumanoid info='"humanoidVersion=2.0"' loa='-1' name='HumanoidStub' skeletalConfiguration='BASIC' version='2.1'>
      <HAnimPose USE='A_Pose'/>
      <HAnimPose USE='T_Pose'/>
      <HAnimPose USE='I_Pose'/>
      <HAnimPose USE='H_Pose'/>
      <HAnimPose USE='FaceLeft_Pose'/>
      <HAnimPose USE='FaceRight_Pose'/>
      <HAnimPose USE='TouchDown_Pose'/>
    </HAnimHumanoid>
  </Scene>
</X3D>