<div dir="auto">I think Blender’s point would be, sure the z is coming out of the book in the cartesian coordinate system, into the sky. Apparently they weren’t paying attention to the teacher at the black board.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 25, 2024 at 4:09 AM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Probably this will be ignored. Joe makes a valid point on this one.</div><div dir="auto"><br></div><div dir="auto">This comment is about X3D and Blender, not glTF and Blender. “Sorted out,” but look at the coordinate axes with when you load a typical coordinate X3D coordinate axes (with x,y,z labels) into Blender. Then look at what Blender thinks in the coordinate axes gizmo (see the bulbous X,Y,Z coordinates with red, green, blue coloring).</div><div dir="auto"><br></div><div dir="auto">Nothing has changed but defaults, AFAIK, which I have been trying to override.</div><div dir="auto"><br></div><div dir="auto">What we really want is Blender’s “floor” to be in the X-Z plane. You can make the “floor” as a “wall” be in the X-Z plane by choosing the correct viewpoint, but try to move the gizmo slightly. What they’ve done is put the “floor” grid in the X-Z plane temporarily (as a wall). Try moving the gizmo and watch the “floor” flip out of the X-Z plane.</div><div dir="auto"><br></div><div dir="auto">It’s a marketing ploy…the Emperor has no clothes.</div><div dir="auto"><br></div><div dir="auto">We’d be perfectly happy if we could select which plane the Blender “floor” was in, with no changes to the defaults. In python, please!</div><div dir="auto"><br></div><div dir="auto">If you hit Num pad 7 in Blender, you will see the typical X3D viewpoint with +Y up, +Z towards the viewer, and +X to the right, just like you learned in high school, just like OpenGL. The only problem is the floor is now a wall! Indeed, it looks a lot like the Cartesian Coordinate System we all learned, with the grid in the a X-Y plane. But wait, the grid is supposed to be the floor, I thought…</div><div dir="auto"><br></div><div dir="auto">Don’t look at the model! Look at the gizmo! Look at them both!</div><div dir="auto"><br></div><div dir="auto">I don’t know what Blender was thinking making the floor so hard to change. If we could shift some concrete there, that would be great!</div><div dir="auto"><br></div><div dir="auto">The great trick is to make the standard floor invisible and draw your own floor, which I haven’t done yet because I’ve been struggling with elasticman. If someone does that to you, try selecting the grid. You can’t select the floor grid in normal Blender. Zorro unmasked!</div><div dir="auto"><br></div><div dir="auto">Where’s this is really going to hurt everyone is when we try to introduce animations, that’s where elasticman steps in. We’re going to have to apply Blender’s ideas to our interpolators. That means negating z…what does that mean for orientation interpolators? Just negate Z there? Really, if someone has an answer for this, you earn a gold star in my book! Euler angles with negated z???</div><div dir="auto"><br></div><div dir="auto">Hopefully we can solve animations without forcing everything to default X3D axes (which was what I was trying to do by setting up to be forward and forward, up—please check my math—I’ll probably change my Blender importer back to that). That’s in __init__.py and can be set on import separate from export.</div><div dir="auto"><br></div><div dir="auto">What happens when you swap -Z with Z in your animations? What do you also do on export? Have we even considered export yet?</div><div dir="auto"><br></div><div dir="auto">Hopefully, the underlying code is doing rotation and not scaling!</div><div dir="auto"><br></div><div dir="auto">I think the safest bet is loading X3D models “laying down” and moving the floor underneath their feet. This will give +Y above the models head, +Z in front of the model, and +X to the models left.</div><div dir="auto"><br></div><div dir="auto">I’m not seeing importing X3D animations into blender coming to X3D soon until everyone gets their heads out of the sand.</div><div dir="auto"><br></div><div dir="auto">I heard that HAnim was built on dead people’s measurements. If we get more people’s eyes on the technical details, maybe Blender won’t kill X3D.</div><div dir="auto"><br></div><div dir="auto">I really like that Blender uses a right hand coordinate system!</div><div dir="auto"><br></div><div dir="auto">Oh, I believe you can set floor *constraints* for an object. If you can set the floor constraints to the fake floor, maybe that would work?</div><div dir="auto"><br></div><div dir="auto">I sure wish it was as easy as swapping -Z for Z. In my dreams!</div><div dir="auto"><br></div><div dir="auto">Does glTF animation work in Blender?</div><div dir="auto"><br></div><div dir="auto">I’m sure smarter people than me have been down this path, why HAnim is not implemented in Blender, why animation import is disabled, etc. I’m just a math dummy who thinks it’s possible, indeed, I wrote an HAnim exporter that mostly worked with one use case. No one gave me any other use cases, so I started my own HAnim importer.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Perhaps we should only focus on Blender exports? Anyone? This seems like a higher priority. But then, do we expect HAnim names? How do we map Transforms to HAnim? Been there, done that: <div dir="auto"><a href="https://github.com/coderextreme/HAnimDecoratorAssembly" target="_blank">https://github.com/coderextreme/HAnimDecoratorAssembly</a> let me know if someone wants me to work on that, but I require HAnim names for Transforms. My system is limited to 32GB. For larger skins (500000 polys), I’ll probably have to recode in something besides Perl. X3DJSAIL is likely, if it’s ready to handle the workload.</div></div><div dir="auto"><br></div><div dir="auto">Maybe moving Blender’s floor is a bit like moving the lid of a coffin? <div dir="auto"><a href="https://youtu.be/6o2gISJYwQU?si=uuCoKE8W_-6NBBEp" target="_blank">https://youtu.be/6o2gISJYwQU</a> Motel is glTF, Blender is Tzietel, and Lazar Wolf is X3D? That scene was pretty terrifying as a 7 year old.</div></div><div dir="auto"><br></div><div dir="auto">Maybe we should fork Blender?</div><div dir="auto"><br></div><div dir="auto">Another thing I see with importing animations is PREF_FLAT equals True (current). This currently wipes out intermediate transforms, and puts them on shapes (there’s a hierarchy of shapes with associated matrices in blender). So how the heck are we supposed to animate intermediate Transforms if they aren’t there? This whole thing needs to be rethought. We should start by looking at creating EMPTY objects as Transforms, as Joe said. Then we need to think about what to do on export. Since I just tripped upon a hierarchy of shapes (Thanks, Katy), this whole thing might need to be thought out. Fortunately, Katy’s example exports well with Blender’s exporter (but I’ve not tried recently, since the -Z/Z change.</div><div dir="auto"><br></div><div dir="auto">If people want to get serious about HAnim and animations in Blender, and have mental capacity to understand the issues with PREF_FLAT, the effect of animating X3D files in Blender with different coordinate systems and import/export of animations, especially skin weights, maybe we can talk. I’m yottzumm on Discord and I hang out in The CGE, MSF and Khronos servers (friend me). I’m also on a Blender server, but there’s probably many.</div><div dir="auto"><br></div><div dir="auto">Maybe we should just prioritize creating glTF and OpenUSD from X3D?</div><div dir="auto"><br></div><div dir="auto">John </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 24, 2024 at 8:11 PM Brutzman, Donald (Don) (CIV) via x3d-public <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</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 dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
Your definition sounds good to me. Glad to hear that this is consistently sorted out and implemented in recent Blender version.</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
Here are X3D Tooltip hints for Viewpoint and orientation:</div>
<ul style="list-style-type:disc">
<li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif">X3D Tooltips: Viewpoint</div>
</li><li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif">Viewpoint provides a specific location and direction where the user may view the scene. Viewpoints are the primary way for a user to navigate within a scene, and for an author to show critical aspects of a model. Unless modified
by the orientation field, the default direction for a Viewpoint to look is along the -Z axis. </div>
</li><li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif"><a href="https://www.web3d.org/x3d/content/X3dTooltips.html#Viewpoint" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif" target="_blank">https://www.web3d.org/x3d/content/X3dTooltips.html#Viewpoint</a></div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif"><br>
</div>
</div>
</li><li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
<div style="margin:0px;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif">X3D Tooltips: Viewpoint orientation</div>
</li><li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif"><a href="https://www.web3d.org/x3d/content/X3dTooltips.html#Viewpoint.orientation" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif" target="_blank">https://www.web3d.org/x3d/content/X3dTooltips.html#Viewpoint.orientation</a></div>
</li><li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif"><b style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif">[orientation <a href="https://www.web3d.org/x3d/content/X3dTooltips.html#accessType" id="m_4205314646044889575m_-7132815826132124438OWA0c5c34c5-9ae6-ba96-ada6-7e542a63a5e1" title="initializable field that can send or receive events at run time" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif" target="_blank">
accessType inputOutput</a>, <a href="https://www.web3d.org/x3d/content/X3dTooltips.html#SFRotation" id="m_4205314646044889575m_-7132815826132124438OWAf304c919-0588-52b5-b051-a5660baf03f8" title="Single-Field 4-tuple value" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif" target="_blank">
type SFRotation</a> <a href="https://www.web3d.org/x3d/content/X3dTooltips.html#CDATA" id="m_4205314646044889575m_-7132815826132124438OWA9f162e5e-a6df-d2be-f707-24781b9c5c3a" title="CDATA means Character Data plain text (DTD validation)" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif" target="_blank">
CDATA</a> "0 0 1 0"]</b><br>
Rotation (axis, angle in radians) of Viewpoint, relative to default -Z axis direction in local coordinate system.<br>
<b style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif">Hint:</b> this is orientation _change_ from default direction (0 0 -1).<br>
<b style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif">Hint:</b> complex rotations can be accomplished axis-by-axis using parent Transforms.<br>
<b style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif">Warning:</b> for VR/AR/MR/XR users wearing a head-mounted display (HMD), animating this field may induce motion sickness.</div>
</li></ul>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
Improvements always welcome. Have fun with X3D! 🙂</div>
<div id="m_4205314646044889575m_-7132815826132124438Signature">
<p style="margin:0in;font-family:Calibri,sans-serif;font-size:11pt"><span style="font-family:"Courier New";font-size:9pt"><br>
</span></p>
<p style="margin:0in;font-family:Calibri,sans-serif;font-size:11pt"><span style="font-family:"Courier New";font-size:9pt">all the best, Don</span></p>
<p style="margin:0in;font-family:Calibri,sans-serif;font-size:11pt"><span style="font-family:"Courier New";font-size:9pt">--</span></p>
<p style="margin:0in;font-family:Calibri,sans-serif;font-size:11pt"><span style="font-family:"Courier New";font-size:9pt">Don Brutzman Naval Postgraduate School, Code USW/Br <a href="mailto:brutzman@nps.edu" style="font-family:"Courier New"" target="_blank">brutzman@nps.edu</a></span></p>
<p style="margin:0in;font-family:Calibri,sans-serif;font-size:11pt"><span style="font-family:"Courier New";font-size:9pt">Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149</span></p>
<p style="margin:0in;font-family:Calibri,sans-serif;font-size:11pt"><span style="font-family:"Courier New";font-size:9pt">X3D graphics, virtual worlds, navy robotics <a href="https://faculty.nps.edu/brutzman" style="font-family:"Courier New"" target="_blank">https://faculty.nps.edu/brutzman</a></span></p>
<p style="margin:0in;font-family:Calibri,sans-serif;font-size:11pt"><span style="font-family:"Courier New";font-size:9pt"> </span></p>
</div>
<div id="m_4205314646044889575m_-7132815826132124438appendonsend"></div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
<br>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_4205314646044889575m_-7132815826132124438divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><b style="font-family:Calibri,sans-serif">From:</b> x3d-public <<a href="mailto:x3d-public-bounces@web3d.org" style="font-family:Calibri,sans-serif" target="_blank">x3d-public-bounces@web3d.org</a>> on behalf of vmarchetti--- via x3d-public <<a href="mailto:x3d-public@web3d.org" style="font-family:Calibri,sans-serif" target="_blank">x3d-public@web3d.org</a>><br>
<b style="font-family:Calibri,sans-serif">Sent:</b> Sunday, November 24, 2024 11:39 AM<br>
<b style="font-family:Calibri,sans-serif">To:</b> X3D-Public <<a href="mailto:x3d-public@web3d.org" style="font-family:Calibri,sans-serif" target="_blank">x3d-public@web3d.org</a>><br>
<b style="font-family:Calibri,sans-serif">Cc:</b> <a href="mailto:vmarchetti@kshell.com" style="font-family:Calibri,sans-serif" target="_blank">vmarchetti@kshell.com</a> <<a href="mailto:vmarchetti@kshell.com" style="font-family:Calibri,sans-serif" target="_blank">vmarchetti@kshell.com</a>><br>
<b style="font-family:Calibri,sans-serif">Subject:</b> [x3d-public] X3D, Blender, and which way is up.</font>
<div> </div>
</div></div><div dir="ltr">
<div style="line-break:after-white-space">I've seen that the email thread starting with the minutes of the last Blender-X3D support call had a subthread about the orientation conventions that glTF, Blender, and X3D use.
<div><br>
</div>
<div>I recommend Michalis' answer at <a href="https://web3d.org/pipermail/x3d-public_web3d.org/2024-November/020882.html" target="_blank">https://web3d.org/pipermail/x3d-public_web3d.org/2024-November/020882.html</a>.</div>
<div><br>
</div>
<div>One confusing aspect is that not only do Blender and glTF disagree about which axis is forward, they disagree about what the word "forward" means.</div>
<div><br>
</div>
<div>For Blender, the word "forward" refers to the axis that the viewer is looking along when they are viewing the front of the model. </div>
<div>The viewer is translated from the model in the -Y direction, and they are looking in the +Y direction. That, +Y, is Blender "forward"</div>
<div><br>
</div>
<div>glTF defined "forward" by the model.Looking at the first sentence of the of section 3.4 of the glTF specification. <a href="https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#coordinate-system-and-units" target="_blank">https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#coordinate-system-and-units</a>, </div>
<div><span style="font-family:-webkit-standard;font-size:medium"><br>
</span></div>
<blockquote type="cite">
<div><span style="font-family:-webkit-standard;font-size:medium">glTF uses a right-handed coordinate system. glTF defines +Y as up, +Z as forward, and -X as right; the front of a glTF asset faces +Z.</span></div>
</blockquote>
<div><br>
</div>
<div><br>
</div>
<div>glTF says the "forward" refers to the direction the asset, a.k.a. model is facing and the spec shows this example picture . In Blender terminology this model is oriented "-Z forward"</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><img alt="boombox.png" src="cid:ii_1936225282fdb107a741" style="width:254px;max-width:100%"></div>
<div><br>
</div>
<div>The X3D standard has the same orientation convention as glTF, by virtue of the X3D default placement of the Viewpoint at a Z=+10 position and looking in the -Z direction. That is why in Blender terminology the X3D convention should be considered -Z forward.
The code in the Blender extensions server was changed to this default for X3D import and export on Nov 4 2024 and this default is in release 2.4.0 of this Blender extension.</div>
<div><br>
</div>
<div>Vince Marchetti</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</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>
</blockquote></div></div>
</blockquote></div></div>