1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "https://www.web3d.org/specifications/x3d-4.0.dtd">
|
3 | <X3D profile='Immersive' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'> |
4 | <head> |
5 | <meta name='title' content=' HAnimPosePrototype.x3d '/> |
6 | <meta name='description' content='Define an experimental new node to simply capture a single pose for an HAnimHumanoid model.'/> |
7 | <meta name='created' content='4 April 2025'/> |
8 | <meta name='modified' content='5 April 2025'/> |
9 | <meta name='creator' content='Don Brutzman'/> |
10 | <meta name='creator' content='Joe Williams'/> |
11 | <meta name=' warning ' content=' under development '/> |
12 | <meta name='reference' content=' HAnimPoseDesignNotes19MAR2025.pdf '/> |
13 | <meta name='reference' content='HAnim Architecture volume 1 version 2.0, clause 4.8.2 Modelling of human-like HAnim figures, https://www.web3d.org/documents/specifications/19774/V2.0/Architecture/concepts.html#ModellingOfHumanLikeHAnimFigures'/> |
14 | <meta name='reference' content='HAnim Architecture volume 1 version 2.0, clause 4.8.3 Poses, https://www.web3d.org/documents/specifications/19774/V2.0/Architecture/concepts.html#Poses'/> |
15 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/HelloWorldScenes/HAnimPosePrototype.x3d '/> |
16 | <meta name='license' content=' https://www.web3d.org/x3d/content/examples/license.html '/> |
17 | <meta name='generator' content='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/> |
18 | </head> |
19 | <Scene> |
20 | <!-- Example scene to illustrate X3D nodes and fields (XML elements and attributes) --> |
21 | <WorldInfo DEF='ModelInfo' info='"Design to illustrate a potential HAnimPose node"' title='HAnimPose Prototype'/> |
22 | <NavigationInfo/> |
23 | <ProtoDeclare name='HAnimPose' appinfo='Assumes HAnimHumanoid configuration must be in I pose, which can be achieved by resetting every HAnimJoint to default values'> |
24 | <ProtoInterface> |
25 |
<field name='enabled' type='SFBool' value='true' accessType='inputOutput'
appinfo='default value true'/> |
26 |
<field name='setPose' type='SFBool' accessType='inputOnly'
appinfo="this event tells the HAnimPose node to do it's thing!"/> |
27 |
<field name='name' type='SFString' value='PoseName' accessType='inputOutput'
appinfo='name of this pose'/> |
28 |
<field name='namesPoseJoints' type='MFString' value='"nameJoint1" "nameJoint2" "nameJoint3" "nameJoint4"' accessType='inputOutput'
appinfo='names of joints in pose'/> |
29 |
<field name='positionsPoseJoints' type='MFVec3f' accessType='inputOutput'
appinfo='positions of joints in pose'/> |
30 |
<field name='rotationsPoseJoints' type='MFRotation' accessType='inputOutput'
appinfo='rotations of joints in pose'/> |
31 |
<field name='whichChoice' type='SFInt32' accessType='inputOutput'
appinfo='selects one of the HAnimHumanoid nodes'/> |
32 |
<field name='children' type='MFNode' accessType='inputOutput'
appinfo='references one or more HAnimHumanoid nodes, typically via USE references'/> |
33 |
<field name='addChildren' type='MFNode' accessType='inputOnly'
appinfo='references one or more HAnimHumanoid nodes, typically via USE references'/> |
34 |
<field name='removeChildren' type='MFNode' accessType='inputOnly'
appinfo='references one or more HAnimHumanoid nodes, typically via USE references'/> |
35 |
<field name='traceEnabled' type='SFBool' value='true' accessType='inputOutput'
appinfo='debug trace to Browser output console'/> |
36 | </ProtoInterface> |
37 | <ProtoBody> |
38 | <!-- First node determines node type of this prototype --> |
39 | <Switch DEF='PrototypeRootNode' whichChoice='-1'> |
40 | <IS> |
41 | <connect nodeField='whichChoice' protoField='whichChoice'/> |
42 | <connect nodeField='children' protoField='children'/> |
43 | <connect nodeField='addChildren' protoField='addChildren'/> |
44 | <connect nodeField='removeChildren' protoField='removeChildren'/> |
45 | </IS> |
46 | </Switch> |
47 | <!-- Subsequent nodes do not render, but still must be a valid X3D subgraph --> |
48 | <MetadataString name='interface' reference='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/concepts.html#InterfaceHierarchy' value='"X3DGroupingNode"'/> |
49 | <!-- This embedded Script provides the X3D author with additional visibility and control over prototype inputs and outputs --> |
50 | <Script DEF='HAnimPoseScriptOperations' directOutput='true'> |
51 |
<field name='enabled' type='SFBool' accessType='inputOutput'
appinfo='default value true'/> |
52 |
<field name='setPose' type='SFBool' accessType='inputOnly'
appinfo="this event tells the HAnimPose node to do it's thing!"/> |
53 |
<field name='name' type='SFString' accessType='inputOutput'
appinfo='name of this pose'/> |
54 |
<field name='namesPoseJoints' type='MFString' accessType='inputOutput'
appinfo='names of joints in pose'/> |
55 |
<field name='positionsPoseJoints' type='MFVec3f' accessType='inputOutput'
appinfo='positions of joints in pose'/> |
56 |
<field name='rotationsPoseJoints' type='MFRotation' accessType='inputOutput'
appinfo='rotations of joints in pose'/> |
57 |
<field name='whichChoice' type='SFInt32' accessType='inputOutput'
appinfo='selects one of the HAnimHumanoid nodes'/> |
58 |
<field name='children' type='MFNode' accessType='inputOutput'
appinfo='references one or more HAnimHumanoid nodes, typically via USE references'/> |
59 |
<field name='addChildren' type='MFNode' accessType='inputOnly'
appinfo='references one or more HAnimHumanoid nodes, typically via USE references'/> |
60 |
<field name='removeChildren' type='MFNode' accessType='inputOnly'
appinfo='references one or more HAnimHumanoid nodes, typically via USE references'/> |
61 |
<field name='traceEnabled' type='SFBool' accessType='inputOutput'
appinfo='debug trace to Browser output console'/> |
62 | <IS> |
63 | <connect nodeField='enabled' protoField='enabled'/> |
64 | <connect nodeField='setPose' protoField='setPose'/> |
65 | <connect nodeField='name' protoField='name'/> |
66 | <connect nodeField='namesPoseJoints' protoField='namesPoseJoints'/> |
67 | <connect nodeField='positionsPoseJoints' protoField='positionsPoseJoints'/> |
68 | <connect nodeField='rotationsPoseJoints' protoField='rotationsPoseJoints'/> |
69 | <connect nodeField='whichChoice' protoField='whichChoice'/> |
70 | <connect nodeField='children' protoField='children'/> |
71 | <connect nodeField='addChildren' protoField='addChildren'/> |
72 | <connect nodeField='removeChildren' protoField='removeChildren'/> |
73 | <connect nodeField='traceEnabled' protoField='traceEnabled'/> |
74 | </IS> |
<![CDATA[
ecmascript: // Needed functionality: // a. get access to a humanoid // b. confirm skeletalConfiguration = 'BASIC' so we know that it has a valid default pose // c. walk the tree for all joints, then set transation, scale, rotation to default values // d. for each name/position/rotation triplet in the pose arrays, update the appropriate // HAnimJoint nodes to that corresponding set of values var scriptName='HAnimPoseScript'; function initialize () { // TODO author initialization code (if any) goes here // check that array sizes are identical for namesPoseJoints, positionsPoseJoints, rotationsPoseJoints // check humanoid connectivity tracePrint ('initialization() successful'); } function set_enabled (eventValue) { // input eventValue received for inputOutput field enabled enabled = eventValue; tracePrint ('enabled = ' + enabled); // TODO author code (if any) goes here } function setPose (eventValue) { // input eventValue received for inputOnly field setPose setPose = eventValue; tracePrint ('setPose = ' + setPose); // TODO author code (if any) goes here } function set_name (eventValue) { // input eventValue received for inputOutput field name name = eventValue; tracePrint ('name = ' + name); // TODO author code (if any) goes here } function set_namesPoseJoints (eventValue) { // input eventValue received for inputOutput field namesPoseJoints namesPoseJoints = eventValue; tracePrint ('namesPoseJoints = ' + namesPoseJoints); // TODO author code (if any) goes here } function set_positionsPoseJoints (eventValue) { // input eventValue received for inputOutput field positionsPoseJoints positionsPoseJoints = eventValue; tracePrint ('positionsPoseJoints = ' + positionsPoseJoints); // TODO author code (if any) goes here } function set_rotationsPoseJoints (eventValue) { // input eventValue received for inputOutput field rotationsPoseJoints rotationsPoseJoints = eventValue; tracePrint ('rotationsPoseJoints = ' + rotationsPoseJoints); // TODO author code (if any) goes here } function set_humanoid (eventValue) { // input eventValue received for inputOutput field humanoid humanoid = eventValue; tracePrint ('humanoid = ' + humanoid); // TODO author code (if any) goes here } // ================== Trace output functions ================== function tracePrint (outputString) { // if traceEnabled is true, print outputString on X3D browser console if (traceEnabled) Browser.println ('[' + scriptName.toString()' ' + name.toString()': ' + outputString.toString() + ']'); } function alwaysPrint (outputString) { // always print outputString on X3D browser console Browser.println ('[' + scriptName.toString()' ' + name.toString()': ' + outputString.toString() + ']'); } function set_traceEnabled (eventValue) { // input eventValue received for inputOutput field traceEnabled = eventValue; } // ===========================================================
]]>
|
|
76 | </Script> |
77 | <!-- Add any ROUTEs here that connect Script to/from prior nodes within ProtoBody --> |
78 | <!-- This embedded Script provides the X3D author with additional visibility and control over prototype inputs and outputs --> |
79 | <!-- Add any ROUTEs here that connect Script to/from prior nodes within ProtoBody --> |
80 | </ProtoBody> |
81 | </ProtoDeclare> |
82 | <ProtoInstance name='HAnimPose'> |
83 | <fieldValue name='name' value='A'/> |
84 | <fieldValue name='namesPoseJoints' value='"l_hip" "r_hip"'/> |
85 | <fieldValue name='positionsPoseJoints' value='0 0 0 0 0 0'/> |
86 | <fieldValue name='rotationsPoseJoints' value='0 0 1 0.2 0 0 1 -0.2'/> |
87 | </ProtoInstance> |
88 | <ProtoInstance name='HAnimPose'> |
89 | <fieldValue name='name' value='T'/> |
90 | <fieldValue name='namesPoseJoints' value='"l_shoulder" "r_shoulder"'/> |
91 | <fieldValue name='positionsPoseJoints' value='0 0 0 0 0 0'/> |
92 | <fieldValue name='rotationsPoseJoints' value='0 0 1 1.57 0 0 1 -1.57'/> |
93 | </ProtoInstance> |
94 | <!-- Add any ROUTEs here that connect ProtoInstance to/from prior nodes in Scene (and outside of ProtoDeclare) --> |
95 | </Scene> |
96 | </X3D> |
Event Graph ROUTE Table with 0 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.
HAnimPoseScriptOperations
Script |
No direct ROUTE connection found for events to/from this node. Contains MFNode fields with direct access to another node. This Script has no direct access to other nodes. |
line 82
ProtoInstance HAnimPose |
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. |
line 88
ProtoInstance HAnimPose |
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. |
<!--
Color-coding 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)
<ProtoInstance name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->