<div dir="auto">The global matrix rotation to adjust coordinates  space in Blender is in __init__.py. I can’t comment on glTF. Both export and import are treated differently. There’s have been recent discussions on the Blender website which people are welcome to join:</div><div dir="auto"><br></div><div dir="auto"><div><a href="https://projects.blender.org/extensions/io_scene_x3d/issues/24">https://projects.blender.org/extensions/io_scene_x3d/issues/24</a></div><div dir="auto"><br></div><div dir="auto"><div><a href="https://projects.blender.org/extensions/io_scene_x3d/commit/6c5160405ed9f64610c78b76849cf547d493baa2">https://projects.blender.org/extensions/io_scene_x3d/commit/6c5160405ed9f64610c78b76849cf547d493baa2</a></div><br></div><div dir="auto"><br></div><div dir="auto">Note the RGB gizmo in my images versus Cedric’s.</div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 14, 2024 at 12:07 AM Michalis Kamburelis 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-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">1. I see there's some talk in this thread about Blender coordinate<br>
system. Let me try to clear things up :)<br>
<br>
I would recommend everyone to just fire up Blender and check what it<br>
actually does :) These things are trivial to see in 3D space in<br>
Blender, there's even a helpful gizmo showing axis, you can play<br>
around and verify what coordinate system it uses.<br>
<br>
To be clear, Blender doesn't use exactly Direct3D coordinate system<br>
(which I think Joe refers to when he writes "Dx").<br>
<br>
The way things are, up to my knowledge:<br>
<br>
- Blender, just like glTF, just like X3D, just like (by default)<br>
OpenGL, just like Castle Game Engine, uses right-handed coordinate system.<br>
<br>
- This is different than Direct3D that uses left-handed coordinate system.<br>
<br>
The "left/right-handedness" is an independent decision from "what is<br>
up by convention":<br>
<br>
- Blender, just like 3ds Max, chose Z as "up" vector by convention.<br>
<br>
- This is different than glTF, X3D, Unity, Godot, Castle Game Engine<br>
where we chosen "Y up". And that's why various exporters (from glTF,<br>
from X3D...) need an option to "change to +Y up convention".<br>
<br>
Disclaimer: talking about "coordinate system" for rendering libraries<br>
like OpenGL or Direct3D is only talking about conventions. They can be<br>
adjusted.<br>
<br>
See also graphic on<br>
<a href="https://www.reddit.com/r/gamedev/comments/b6ujvb/y_axis_up_or_z_axis_up/" rel="noreferrer" target="_blank">https://www.reddit.com/r/gamedev/comments/b6ujvb/y_axis_up_or_z_axis_up/</a><br>
. Yeah, the world is complicated, unfortunately there are a few<br>
decisions and lots of things made different choices :)<br>
<br>
2. Converting "up Z" to "up Y" (when both systems are right-handed) is<br>
a matter of rotating the model (around X axis by 90 degrees).<br>
<br>
You can explore how it is done by glTF exporter when "+Y Up" is<br>
selected in the GUI by checking out<br>
<a href="https://github.com/KhronosGroup/glTF-Blender-IO" rel="noreferrer" target="_blank">https://github.com/KhronosGroup/glTF-Blender-IO</a> sources and grepping<br>
for "gltf_yup". You can also experiment by exporting models from<br>
Blender and looking at output (convert it e.g. using Castle Model<br>
Viewer to see X3D).<br>
<br>
>From what I can see, it is *not* just adding a top-level rotation,<br>
it's actually rotating all the data inside.<br>
<br>
Regards,<br>
Michalis<br>
<br>
czw., 14 lis 2024 o 05:18 Joe D Williams via x3d-public<br>
<<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>> napisał(a):<br>
<br>
><br>
><br>
> -----Forwarded Message-----<br>
> From: Joe D Williams <<a href="mailto:joedwil@earthlink.net" target="_blank">joedwil@earthlink.net</a>><br>
> Sent: Nov 13, 2024 7:38 PM<br>
> To: Vincent Marchetti <<a href="mailto:vmarchetti@kshell.com" target="_blank">vmarchetti@kshell.com</a>><br>
> Cc: X3D Ecosystem public discussion <<a href="mailto:x3d-ecosystem@web3d.org" target="_blank">x3d-ecosystem@web3d.org</a>><br>
> Subject: Re: [x3d-public] [x3d] Minutes from Nov 12 X3D Blender suppport call<br>
><br>
> Hi Vince,<br>
> The basic idea is that x3d is cast in the GL coordinate system where +y is up, model faces +z is toward the viewer, and +x is to the model left, viewer right. Axis rotations follow right hand rule. + is ccw. .<br>
> So for the ideal HAnim source pose before animation all joints and points are 0 0 1 0.<br>
> The host world coord sys is same as hanim model coord sys.<br>
><br>
> From what I seem to see I think the Blender world coordinate system is +z up and left hand rule for rotations. That is why the gltf needs the +Yup flag, because gltf is cast in GL coord sys.<br>
> I am not sure what that gltf export +Yup flag does to the data from blender. Does it just do that x-axis rotation, or more?<br>
><br>
> So, this may be called the problem of using a Dx model in a GL system. Converting seems not so easy to export by just rotation of x-axis as shown in the example because joint and point coordinates may not be as expected GL and x3d 0 0 1 0 and animations may be a further problem.<br>
><br>
> This is opportunity that needs some <a href="http://work.to" rel="noreferrer" target="_blank">work.to</a> understand. Right,we need a simple example that shows default x3d model coordinate system and a simple animation in that system,, import to Blender and see what happens, make some simple mods and animations then see what it exports and how it plays in x3d. Turns out that Vulcan is the only khronos that uses what think is the Dx as a basis<br>
><br>
> John actually has some experience in this in his work with the kicker.<br>
><br>
> Good Luck, it is Important, since may authoring and run times have chosen the Dx and others something different from either.<br>
><br>
> All Best,<br>
> Joe<br>
><br>
><br>
> -----Original Message-----<br>
> From: Vincent Marchetti<br>
> Sent: Nov 13, 2024 1:24 PM<br>
> To: Joe D Williams<br>
> Cc: X3D Ecosystem public discussion<br>
> Subject: Re: [x3d-public] [x3d] Minutes from Nov 12 X3D Blender suppport call<br>
><br>
> I have seen this issue brought up before. Is the problem particular to exporting HAnim type models, or is it generic to all Blender to X3D exports<br>
><br>
> What would help understand and potentially create a solution would be if someone created a .blend file that had<br>
> -- a single shape, with low poly mesh but with a visually obvious front and up direction<br>
> -- that shape oriented in Blender space with the up direction along Blender +Z and the forward direction along Blender -Y, and this achieved without any rotation of the mesh defined in Blender.<br>
><br>
> Then we can examine X3D exports with various options to see if there's a problem to fix in the code.<br>
><br>
> Vince Marchetti<br>
><br>
><br>
> > On Nov 13, 2024, at 4:03 PM, Joe D Williams wrote:<br>
> ><br>
> > <a href="https://github.com/andreasplesch/x3dom/wiki/RiggedSimple-glTF-conversion" rel="noreferrer" target="_blank">https://github.com/andreasplesch/x3dom/wiki/RiggedSimple-glTF-conversion</a><br>
> ><br>
> > X3D<br>
> > experimental xml<br>
> > ...<br>
> ><br>
> > Transform DEF='node_0' rotation='1 0 0 1.57<br>
> ><br>
> > This is not good. It shows the thing was drawn +zup.<br>
> > This should be fixed in blender either by fixing blender to do the GL default, not depending on the Transform of the model to put the thing into GL space.<br>
> > Thanks,<br>
> > Joe<br>
> > -----Original Message-----<br>
> > From: Extensible 3D (X3D) Graphics public discussion<br>
> > Sent: Nov 13, 2024 8:00 AM<br>
> > To: Vincent Marchetti , X3D Ecosystem public discussion , ,<br>
> > Cc: Joe D Williams<br>
> > Subject: Re: [x3d-public] [x3d] Minutes from Nov 12 X3D Blender suppport call<br>
> ><br>
> > So, to me for hanim it seems like we must fix Blender at the source.<br>
> > Just about the idea that Blender considers all Joints can affect all points, seems like that is a non-starter. Doesn't this liimit the skeleton-driven skin animation to less than 16 Joint nodes?<br>
> > If so, then Blender needs to be fixed to operate more like x3d hanim, and every other tool, to allow for more skeleton joints(?) Gltf has a suggested? limit of, four joints to affect any point.<br>
> > What am I missing?<br>
> > Thanks for all the great work on this import/export with Blender.<br>
> > Joe<br>
> ><br>
> ><br>
> > -----Original Message-----<br>
> > From: Vincent Marchetti<br>
> > Sent: Nov 13, 2024 6:36 AM<br>
> > To: X3D Ecosystem public discussion ,<br>
> > Subject: [x3d] Minutes from Nov 12 X3D Blender suppport call<br>
> ><br>
> > Minutes from the Nov 12 2024 meeting on Blender 4.2 support for X3D are available for view and comment<br>
> ><br>
> > <a href="https://docs.google.com/document/d/1wvjvDpJTMFDMpS53ImuoRHNOCt9zrCiq/edit" rel="noreferrer" target="_blank">https://docs.google.com/document/d/1wvjvDpJTMFDMpS53ImuoRHNOCt9zrCiq/edit</a><br>
> ><br>
> > Vince Marchetti<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > x3d mailing list<br>
> > <a href="mailto:x3d@web3d.org" target="_blank">x3d@web3d.org</a><br>
> > <a href="http://web3d.org/mailman/listinfo/x3d_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d_web3d.org</a><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<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>
> ><br>
> ><br>
><br>
><br>
><br>
><br>
><br>
><br>
> _______________________________________________<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>
<br>
_______________________________________________<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>