<div dir="auto">There are plenty of HAnim JSON examples if glTF wants to glom on!</div><div dir="auto"><br></div><div dir="auto">See HumanoidAnimation in the X3D archives.</div><div dir="auto"><br></div><div dir="auto">E.g.: </div><div dir="auto"><div><a href="https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Characters/JinLOA4.json">https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Characters/JinLOA4.json</a></div><br></div><div dir="auto"><br></div><div dir="auto">If you want JSON from X3D, there’s JSON button in X3D-Edit.</div><div dir="auto"><br></div><div dir="auto">X3DJSAIL also offers conversion from XML to JSON.</div><div dir="auto"><br></div><div dir="auto">As does Holger’s x3d-tidy! (use .x3dj).</div><div dir="auto"><br></div><div dir="auto">Sunrize and X_ITE offer viewing of HAnim JSON.</div><div dir="auto"><br></div><div dir="auto">John </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 22, 2024 at 1:49 PM Joe D Williams <<a href="mailto:joedwil@earthlink.net">joedwil@earthlink.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div style="font-family:arial,sans-serif;font-size:12pt;color:rgb(0,0,0)"><p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif">> <span style="font-family:"Times New Roman";font-size:medium;white-space:normal;float:none;display:inline;color:rgb(0,0,0)">My understanding is that there’s a desire to convert between axis-angle (SFRotation) and quaternions. </span> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif">Please, when you think of legal gltf quaternion data, you must think of _unit_ quaternions. </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif">This conversion is not a desire, simply that the gltf data and other transport forms use unit quaternions. Thus, if I understand, for example to export native x3d animation data to gltf we would need to convert, and to import we either need to convert to x3d native axis-angle or just use unit quaternions under the covers. But if we wanted to import for working with (editing/refining) the data, such as for orientation interpolators, would need to convert. </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif">So, maybe like the SAI has 3x3 and 4x4 matrix operations, we need a way to convert a single or sequence of axis-angle to quaternion for export and the other way for import. I don't think it is useful to allow unit quaternions in x3d user code for rotations or orientations (just hard to work with handed editing) but it seems like it is unavoidable if we want import/export to gltf. Incidentally, the required gltf forms for skeletal hierarchies and animations are still being worked on by a metaverse forum group for interoperable assets. </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif">Finally, looking at the gltf forms for skeleton transform hierarchies and animations, it seems like x3d should develop a set of hanim gltf assets specifically for hanim that use x3d hanim keywords and structures. From what I have seen, which is not much, the gltf useful for hanim content is very general and abstract to the point of not being directly relatable to hanim user code. </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif">Thanks for some deep thoughts on this,</p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif">Joe </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
<p style="margin:0.1rem 0px;line-height:1;font-family:arial,sans-serif"> </p>
</div>
<div style="border-left-width:1px;border-left-style:solid;box-sizing:border-box;padding:10px 0px 10px 15px;margin:0px;border-left-color:rgb(170,170,170)">
<p>-----Original Message-----<br>From: Extensible 3D (X3D) Graphics public discussion <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>Sent: Jul 21, 2024 7:57 PM<br>To: Extensible 3D (X3D) Graphics public discussion <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>Cc: John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>>, x3dom/x3dom <<a href="mailto:x3dom@noreply.github.com" target="_blank">x3dom@noreply.github.com</a>>, Subscribed <<a href="mailto:subscribed@noreply.github.com" target="_blank">subscribed@noreply.github.com</a>>, Johannes Behr <<a href="mailto:johannes.behr@threedy.io" target="_blank">johannes.behr@threedy.io</a>>, Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>><br>Subject: Re: [x3d-public] Add quaternion utility methods to X3D SFRotation programming-language standards?</p>
<p style="margin:0.1rem 0px;line-height:1"> </p>
<div dir="auto">My understanding is that there’s a desire to convert between axis-angle (SFRotation) and quaternions. X3DOM has only supported quaternions in the past, looks like there’s progress! Cross-platform X3D is highly desirable.</div>
<div dir="auto"> </div>
<div dir="auto">Quaternion conversion might be useful to use in Blender export with X3DPSAIL (x3dv.py), but Blender provides utility libraries already, AFAIK. Mostly, I am setting rotations in OrientationInterpolators for HAnim and other animation. Rotations also come into play for orienting coordinate axes. I don’t see quaternions useful there.</div>
<div dir="auto"> </div>
<div dir="auto">
<div><br><span style="font-family:-apple-system,helveticaneue;font-size:19px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important;background-color:rgba(0,0,0,0);border-color:rgb(0,0,0);color:rgb(0,0,0)">For Blender import, working on importing animations for transform-like nodes should be paramount, especially in XML, and may require Blender modifications. If SFRotation methods can help with that, great. AFAIK, though, there’s no SFRotation class in the importer yet.</span></div>
</div>
<div dir="auto"> </div>
<div dir="auto">I stop here talking about quaternions. Begin rant. I’ll peek at the SAI WD now.</div>
<div dir="auto"> </div>
<div dir="auto">
<div dir="auto"><span style="font-family:-apple-system,helveticaneue;font-size:19px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important;color:rgb(0,0,0)">For X3DPSAIL, there’s more important considerations like automated DEF/USE (not for static scenegraphs, but for programs that generate many scenegraphs, with a wide variety of functions), X3D JSON export and integrating container field [ sic ] </span><span style="font-family:-apple-system,helveticaneue;color:rgb(0,0,0)"><span style="font-family:-apple-system,helveticaneue;color:rgb(0,0,0)">output in my mind. These should be priorities over quaternions. We both probably understand the pain of X3D JSON; the good news is, we have pretty reasonable stuff to move between that and XML or DOM. If someone tells me exactly how to read XML, JSON or VRML into an X3DPSAIL scenegraph, I will start looking at how to use X3DPSAIL for Blender import. One possibility is providing Python import to Blender! I totally understand that! Providing X3D to Blender Python conversions is critical for that. See: </span></span>
<div dir="auto" style="font-family:-apple-system,helveticaneue"><a style="font-family:-apple-system,helveticaneue" href="https://github.com/coderextreme/X3DJSONLD/blob/master/blend/localfinal.py" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/blend/localfinal.py</a> for x3d blender python loader, which could be the start of a stylesheet.</div>
</div>
</div>
<div dir="auto"> </div>
<div dir="auto"> </div>
<div dir="auto"> </div>
<div dir="auto">Addition of standard vector/matrix multiplication/inversion operations to X3DJSAIL should be a priority over quaternions. I don’t know if standard matrix operations are part of SAI or not. Since we support matrix and vector fields in X3DJSAIL, operations on these seem obvious. If they are in SAI, X3DJSAIL was lacking as a couple of months ago. I used vecmath.jar. I’m as embarrassed as you are! I realize that’s not the purpose of X3DJSAIL. A pointer to the documentation doesn’t help here.</div>
<div dir="auto"> </div>
<div dir="auto">More priorities for X3DJSAIL: Comprehensive ways to select all instances of a given class in a scenegraph. Ways to filter on nodes with an attribute (DEF) present and value (ala HTML DOM and CSS), realizing libraries like JXPath exist (is there something better?). Convenience methods for removing nodes and statements in a set or two from the scenegraph would allow me to deprecate my code. Understood that this can probably be done with DOM. I may wish to load JavaScript into an X3DJSAIL scenegraph as subclasses of X3DJSAIL through class shims (see my X3Dautoclass.js files for graaljs).</div>
<div dir="auto"> </div>
<div dir="auto">Primarily, I am working on HAnim, and making large models feasible in X3DJSAIL Java and CGE’s x3d Pascal library (X3dToPascal.xslt?) would be nice! Promoting a fluent interface in SAI (setter and adder functions and methods that return a pointer or reference to primary object being worked on) would help with the latter.</div>
<div dir="auto"> </div>
<div dir="auto">Current Pascal generator:</div>
<div dir="auto"><br>
<div dir="auto"><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/PascalSerializer.js" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/PascalSerializer.js</a></div>
<div dir="auto"> </div>
<div dir="auto">
<div dir="auto"><span style="font-family:-apple-system,helveticaneue;font-size:19px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important;background-color:rgba(0,0,0,0);border-color:rgb(0,0,0);color:rgb(0,0,0)">These two HAnim .inc files have issues.</span></div>
</div>
<div dir="auto"> </div>
<div dir="auto">
<div><a href="https://github.com/coderextreme/pascalsai/tree/main/code" target="_blank">https://github.com/coderextreme/pascalsai/tree/main/code</a></div>
</div>
<div dir="auto">If we had a pattern for breaking up a large Java code tree into separate methods , or lengthy Pascal code into “slices” or separate methods, cool. Maybe some online research would reveal something. Maybe we have an existing stylesheet, like the ROUTE visualizer? Hopefully, at some point, I will get some inspiration to solve this problem. It just seems like a command-line parameter that I haven’t looked up.</div>
</div>
<div dir="auto"> </div>
<div dir="auto">John </div>
<div dir="auto"> </div>
</div><div style="border-left-width:1px;border-left-style:solid;box-sizing:border-box;padding:10px 0px 10px 15px;margin:0px;border-left-color:rgb(170,170,170)"><div dir="auto">On Sun, Jul 21, 2024 at 5:01 PM Brutzman, Donald (Don) (CIV) via x3d-public <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>> wrote:</div>
</div><div style="border-left-width:1px;border-left-style:solid;box-sizing:border-box;padding:10px 0px 10px 15px;margin:0px;border-left-color:rgb(170,170,170)"><div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"></blockquote></div></div></div><div style="border-left-width:1px;border-left-style:solid;box-sizing:border-box;padding:10px 0px 10px 15px;margin:0px;border-left-color:rgb(170,170,170)"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
<div>
<div dir="ltr">
<div dir="ltr">Interesting to see in the online issue discussion below that X3DOM includes quaternion methods.</div>
<div dir="ltr"> </div>
<div dir="ltr">The SFRotation representation has some similarity to quaternions, but they are of course mathematically distinct. Quaternions have long been a suggested alternative for X3D, with SFRotation remaining the primary representation since it is much more reviewable and editable (among other reasons). Nevertheless, for programmers, additional flexibility can be considered without conflict. This may encourage X3D API usage with other 3D programming libraries.</div>
<div dir="ltr"> </div>
<div dir="ltr">Please consider and advise whether quaternion-based accessor (get and set) utility methods ought to be added to the X3D specifications for SFRotation data type. Specifically they might become required in X3D Scene Access Interface (SAI), along with all of the future corresponding version 4.0 revisions to X3D programming-language bindings (ECMAScript/JavaScript, Java, C/C++/C#, Python).</div>
<div dir="ltr"> </div>
<div dir="ltr">
<ul style="margin-top:0px;margin-bottom:0px">
<li style="list-style-type:disc"><span style="text-align:start;text-decoration:none;display:inline!important;background-color:rgb(255,255,255)">X3D Scene Access Interface (SAI), version 4.0 draft</span></li>
<li style="list-style-type:disc"><span style="text-align:start;text-decoration:none;display:inline!important;background-color:rgb(255,255,255)"><a href="https://web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-2v4.0-WD1/" rel="noreferrer noopener" target="_blank">https://web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-2v4.0-WD1</a><br></span></li>
</ul>
<div dir="ltr"> </div>
<div dir="ltr">If so, please list what utility methods seem most broadly valuable. <span style="font-size:inherit">Based on responses, Dick and I will work on crafting a Mantis issue and draft specification prose for further review.</span></div>
<div dir="ltr"> </div>
<div dir="ltr"> </div>
<div dir="ltr">At that point, once reasonably well defined, am also willing to add convenience methods in Java X3DJSAIL and Python X3DPSAIL (x3d.py) libraries for testing. Contributions of exemplar source code for those libraries will also be welcome, if anyone wants.</div>
<div dir="ltr"> </div>
<div dir="ltr">Further interesting is the possibility that we are not only supporting future X3D programmers, but potentially also supporting Metaverse requirements for 3D Web Interoperability.</div>
<div dir="ltr"> </div>
<div dir="ltr">For those wanting additional background, more information about X3D data types and SFRotation (plus further links) can be found at</div>
<div dir="ltr"> </div>
<div dir="ltr">
<ul style="margin-top:0px;margin-bottom:0px">
<li style="list-style-type:disc">X3D Tooltips 4.0: field types</li>
<li style="list-style-type:disc"><a href="https://www.web3d.org/x3d/tooltips/X3dTooltips.html#type" rel="noreferrer noopener" target="_blank">https://www.web3d.org/x3d/tooltips/X3dTooltips.html#type</a></li>
<li style="list-style-type:disc"><a href="https://www.web3d.org/x3d/tooltips/X3dTooltips.html#FieldTypesTable" rel="noreferrer noopener" target="_blank">https://www.web3d.org/x3d/tooltips/X3dTooltips.html#FieldTypesTable</a></li>
<li style="list-style-type:disc"><a href="https://www.web3d.org/x3d/tooltips/X3dTooltips.html#SFRotation" rel="noreferrer noopener" target="_blank">https://www.web3d.org/x3d/tooltips/X3dTooltips.html#SFRotation</a></li>
</ul>
</div>
<div dir="ltr"> </div>
<div dir="ltr"><span style="text-decoration:none;display:inline!important;background-color:rgb(255,255,255)">Thanks in advance for considering the possibilities and all feedback.</span></div>
</div>
<div id="m_8992011280137528788m_6923973795315810644ms-outlook-mobile-signature">
<div dir="ltr">
<p style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";line-height:1.5"> </span></p>
<p style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";line-height:1.5">all the best, Don</span></p>
<p style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";line-height:1.5">--<span style="font-family:"Courier New""> </span></span></p>
<p style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";line-height:1.5">Don Brutzman Naval Postgraduate School, Code USW/Br <span style="font-family:"Courier New""> </span><span dir="ltr" style="font-family:"Courier New";color:rgb(0,120,212)"><a style="font-family:"Courier New"" href="mailto:brutzman@nps.edu" rel="noopener" target="_blank">brutzman@nps.edu</a></span></span></p>
<p style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";line-height:1.5">Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA <span style="font-family:"Courier New""> </span><span dir="ltr" style="font-family:"Courier New";color:rgb(0,120,212)">+1.831.656.2149</span></span></p>
<div style="margin:0px 0in;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;font-family:"Courier New";line-height:1.5">X3D graphics, virtual worlds, Navy robotics </span><span style="font-size:10pt;font-family:"Courier New";line-height:1.5"><span dir="ltr" style="font-family:"Courier New";color:rgb(0,120,212)"><a style="font-family:"Courier New"" href="https://faculty.nps.edu/brutzman" rel="noopener" target="_blank">https://faculty.nps.edu/brutzman</a></span></span></div>
</div>
</div>
<div id="m_8992011280137528788m_6923973795315810644mail-editor-reference-message-container"><hr style="display:inline-block;width:98%">
<div id="m_8992011280137528788m_6923973795315810644divRplyFwdMsg" dir="ltr"><span style="font-family:Calibri,sans-serif;color:rgb(0,0,0)"><span style="font-family:Calibri,sans-serif;color:rgb(0,0,0)"><strong style="font-family:Calibri,sans-serif">From:</strong> Andreas Plesch <<a style="font-family:Calibri,sans-serif" href="mailto:notifications@github.com" rel="noopener" target="_blank">notifications@github.com</a>><br><strong style="font-family:Calibri,sans-serif">Sent:</strong> Wednesday, June 26, 2024 11:03 AM<br><strong style="font-family:Calibri,sans-serif">To:</strong> x3dom/x3dom <<a style="font-family:Calibri,sans-serif" href="mailto:x3dom@noreply.github.com" rel="noopener" target="_blank">x3dom@noreply.github.com</a>><br><strong style="font-family:Calibri,sans-serif">Cc:</strong> Subscribed <<a style="font-family:Calibri,sans-serif" href="mailto:subscribed@noreply.github.com" rel="noopener" target="_blank">subscribed@noreply.github.com</a>><br><strong style="font-family:Calibri,sans-serif">Subject:</strong> Re: [x3dom/x3dom] SFMatrix4f() documentation for setRotation and translation (Issue #1322)</span></span>
<div dir="ltr" style="font-family:Calibri,sans-serif"> </div>
</div>
<p> </p>
<div>
<p> </p>
<p dir="auto">SFRotation field methods are also available but less well tested.</p>
<p dir="auto">SAI code may look like this:</p>
<pre class="notranslate" style="font-family:monospace"><code class="notranslate" style="font-family:monospace">SFRot90 = x3dom.fields.SFRotation(1, 0, 0, 1.57);
locR = SFRot90.multiVec(hitP);
trans = new x3dom.fields.SFVec3f(440000, 3670000, 0);
locT = locR.add(trans);
</code></pre>
<p style="font-size:small;color:rgb(102,102,102)">—<br>Reply to this email directly, <a href="https://github.com/x3dom/x3dom/issues/1322#issuecomment-2192318975" rel="noopener" target="_blank"> view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AB23BYDQOLK25VKQG3TBTJ3ZJL65PAVCNFSM6AAAAABJRIL4AOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGMYTQOJXGU" rel="noopener" target="_blank"> unsubscribe</a>.<br>You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AB23BYGS6BIVFIP6Y7ZQM3LZJL65PA5CNFSM6AAAAABJRIL4AOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUCVQQ76.gif" alt="" width="1" height="1"><span style="font-size:0px;display:none;overflow:hidden;opacity:0;width:0px;height:0px;max-width:0px;max-height:0px;color:transparent">Message ID: <x3dom/x3dom/issues/1322/<a href="mailto:2192318975@github.com" target="_blank">2192318975@github.com</a>></span></p>
</div>
</div>
</div>
</div></blockquote></div></div></div><div style="border-left-width:1px;border-left-style:solid;box-sizing:border-box;padding:10px 0px 10px 15px;margin:0px;border-left-color:rgb(170,170,170)"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
_______________________________________________</blockquote></div></div></div><div style="border-left-width:1px;border-left-style:solid;box-sizing:border-box;padding:10px 0px 10px 15px;margin:0px;border-left-color:rgb(170,170,170)"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><br>x3d-public mailing list<br><a href="mailto:x3d-public@web3d.org" rel="noopener" target="_blank">x3d-public@web3d.org</a><br><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noopener noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a></blockquote>
</div>
</div>
</div>
<p style="margin:0.1rem 0px;line-height:1"> </p></blockquote></div></div>