<div dir="ltr"><div>Wow Aaron this is so great!  LOL!   😄 👍</div><div><br></div><div>Observations:</div><div><ul><li>We have seen many variations in XYZ rotation ordering over the years, and should not expect to define the "right" ordering.  Rather we do have to map inconsistencies to a common approach if we want repeatable animation.</li><li>There is a very easy, simple technique to avoid mathematical manipulations when shifting coordinate frames.  Simply have three nested Transform nodes for Roll Pitch Yaw (or whatever they are being called) and set values on each individually.</li><li>These are computationally very efficient.  Browsers likely do that automatically when computing the transformation matrix.</li><li>X3D-Edit Transform node includes a "rotation calculator" that let's an author do that at modeling time, if you want to go further and look for example code.</li><li>The three-nested-Transform-nodes approach is described in X3D for Web Authors book chapter, slideset, and examples.</li></ul><div>and</div></div><div><ul><li>HAnimMotion node carefully includes most of the structural animation found in a BVH file for the same very-good reasons</li><ul><li>the <i>joints </i>field lists names what HAnimHumanoid joints are being animated, in order</li><li>the <i>channels </i>field lists has corresponding information for each joint, describing how many values are found in a row/frame and what axis they correspond to</li><li>thus there is no ambiguity when parsing the <i>values</i> array of frame-by-frame data regarding exactly which rotations go where</li></ul><li>Example from KoreanCharacterMotionAnnexD01Jin.x3d</li><ul><li><HAnimMotion DEF='hanim_motion_animation'  containerField='motions'</li><li>description='BVH-derived dance movement' enabled='true' </li><li>channels='6 Xposition Yposition Zposition Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation 3 Zrotation Xrotation Yrotation' </li><li>joints='HumanoidRoot l_hip l_knee l_talocrural r_hip r_knee r_talocrural vl5 IGNORED l_shoulder l_elbow l_radiocarpal IGNORED r_shoulder r_elbow r_radiocarpal IGNORED skullbase' loop='true' name='motion_animation' </li></ul></ul></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="color:rgb(34,34,34)"><font face="arial, sans-serif">Appreciate your careful diligence with these twists and turns.  Such things are never easy to get exactly correct, but when we align with a shared common standard then we only have to succeed once!</font></div><div style="color:rgb(34,34,34)"><font face="arial, sans-serif"><br></font></div><div style="color:rgb(34,34,34)"><font face="arial, sans-serif">p.s. endless improvement department:  gee when designing HAnimMotion node, i wish we had called the <i>names</i> field <i>jointNames </i>instead for correctness.</font></div><div style="color:rgb(34,34,34)"><font face="monospace"><br></font></div><div style="color:rgb(34,34,34)"><font face="monospace">all the best, Don</font></div><div style="color:rgb(34,34,34)"><font face="monospace">-- </font></div><div style="color:rgb(34,34,34)"><font face="monospace">X3D Graphics, Maritime Robotics, Distributed Simulation</font></div><div style="color:rgb(34,34,34)"><font face="monospace">Relative Motion Consulting  <a href="https://RelativeMotion.info" target="_blank">https://RelativeMotion.info</a></font></div></div></div></div><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Oct 24, 2025 at 8:03 PM Bergstrom, Aaron via x3d-public <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg6076681920094979616">





<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="m_6076681920094979616WordSection1">
<p class="MsoNormal">I successfully implemented HAnimMotion node export from Maya using RawKee.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">You can see a video of the result running in Sunrize<u></u><u></u></p>
<p class="MsoNormal"><a href="https://drive.google.com/file/d/1JBe6kO1UnbsXvfpMKfI-75DhpDdzng-L/view?usp=sharing" target="_blank">https://drive.google.com/file/d/1JBe6kO1UnbsXvfpMKfI-75DhpDdzng-L/view?usp=sharing</a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If you look closely, you will notice that the rotation values are in the following order:<u></u><u></u></p>
<p class="MsoNormal">Xrotation Yrotation Zrotation<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">This is different from the recommend rotation order of:<u></u><u></u></p>
<p class="MsoNormal">Zrotation Xrotation Yrotation<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Here is my justification.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m guessing that mocap systems that use BVH to record data have a rotation order of ZXY.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">However, characters in Maya, at least the ones that I have worked with, have a joint rotation order of XYZ.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Maya allows the artist to choose the rotation order of its joints. So I wrote the exporter so that it would export HAnimMotion nodes based on the joint rotation order chosen by the artist.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The Conan character’s joint rotation order in Maya is XYZ.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">From what I can tell, this is allowed by the spec, even though it might not be the recommended practice.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">It’s just not worth effort for me to do all the math required to force the animator to use an ZXY joint rotation order. Because that would completely mess up the animation within Maya.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The animation in the video looks slightly different than the TimeSensor/Interpolator version of the same animation, because the HAnimMotion version doesn’t export all the joint “translation” animations used by the Advanced Skelton tool.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">This is actually not a problem, as I only told it to export the joint position of the root joint node, but all the rotation values for the entire skeleton. I could have just as easily had RawKee export all the Position and Rotation information
 for all the joint nodes.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">We can debate whether or not I should allow anything other than ZXY joint rotation order, and we can debate whether I should allow position data to be exported for all joints, but it’s essentially working<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">RawKee can now export HAnimMotion nodes.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’ll make a new release available once I’ve cleaned up a couple GUI issues and I enable AudioClip and MovieTexture support.<u></u><u></u></p>
</div>
</div>

_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</div></blockquote></div>