[x3d-public] Row/column-order in the SFMatrix*, MFMatrix* fields, I think X3DOM reading order contrasts to what spec says
Michalis Kamburelis
michalis at castle-engine.io
Sun Nov 23 02:58:28 PST 2025
Thanks Holger too!
Indeed, I was just wrong. Well, so this week I introduced a bug in our engine / viewer, only to fix it later.... At least it wasn't a boring week :)
Regards,
Michalis
On Sunday, November 23rd, 2025 at 11:44, Holger Seelig <holger.seelig at yahoo.de> wrote:
> Michalis,
>
> I think you are making a mistake. X3D matrices are in row-major fashion. From the current X3D4.0 standard:
>
> SFMatrix4d matrices are organized in row-major fashion. The first row of the matrix stores information for the x dimension, the second for the y dimension, and the third for the z dimension. Since these data types are commonly used for 3D transformation matrices, translation values are stored in the fourth row.
>
> This means the matrix should be:
>
> matrix
> 1 0 0 0
> 0 1 0 0
> 0 0 1 0
> 1 2 3 1
>
> The translation values are now in the last row as required by the standard.
>
> See also:
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/fieldTypes.html#SFMatrix4dAndMFMatrix4d
>
> https://en.wikipedia.org/wiki/Row-_and_column-major_order
>
> Best regards,
> Holger
>
> —
> Holger Seelig
> holger.seelig at yahoo.de
>
>> Am 23.11.2025 um 01:38 schrieb Michalis Kamburelis via x3d-public <x3d-public at web3d.org>:
>>
>> matrix
>> 1 0 0 1
>> 0 1 0 2
>> 0 0 1 3
>> 0 0 0 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20251123/ea157477/attachment.html>
More information about the x3d-public
mailing list