[x3d-public] SFRotation default value spec. inconsistency

Joe D Williams joedwil at earthlink.net
Tue Feb 11 09:08:40 PST 2025


in general, if you have three numbers for a rotation it is talking euler angles, Sure there is a conversion to quaternions and axis-angle but we don't do that except when importing some styles of BVH, then we also need to worry about intrinsic and extrinsic rotations, and the order thereof. 
Thanks,
Joe

-----Original Message-----
From: John Carlson <yottzumm at gmail.com>
Sent: Feb 11, 2025 8:47 AM
To: Extensible 3D (X3D) Graphics public discussion <x3d-public at web3d.org>
Cc: Andreas Plesch <andreasplesch at gmail.com>, Joe D Williams <joedwil at earthlink.net>
Subject: Re: [x3d-public] SFRotation default value spec. inconsistency

0 0 0 is not an axis and it’s not normalized.

On Tue, Feb 11, 2025 at 10:40 AM Joe D Williams via x3d-public <x3d-public at web3d.org (mailto:x3d-public at web3d.org)> wrote:
OK, I favor favoring the value in the prime spec, X3D Part 1. Since gltf always uses unit quaternions (that I have seen), if we import or export gltf, then 0 0 0 1 quaternion should probably result to 0 0 1 0 rather that 0 0 0 0. whoever picked 0 0 1 0 might have had a hint that axis-angle 0 0 0 0 might result in some problem sometime.
Thanks,
Joe

----Original Message-----

From: Andreas Plesch <andreasplesch at gmail.com (mailto:andreasplesch at gmail.com)>
Sent: Feb 10, 2025 12:37 PM
To: Joe D Williams <joedwil at earthlink.net (mailto:joedwil at earthlink.net)>
Cc: Extensible 3D (X3D) Graphics public discussion <x3d-public at web3d.org (mailto:x3d-public at web3d.org)>
Subject: Re: [x3d-public] SFRotation default value spec. inconsistency

https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_node_rotation
has indeed (0, 0, 0, 1 XYZW) as a default value.
 
This is difficult to interpret as a rotation around an axis since the corresponding axis would be at first glance (0 0 0).
 
x3dom converts quaternion (0, 0, 0, 1 XYZW) to (axis),angle (0,0,0),0 as does https://www.andre-gaschler.com/rotationconverter/ .
 
On the other hand both SFRotation (0 0 1 0) and SFRotation (0 1 0 0) are also represented by quaternion (0, 0, 0, 1 XYZW).
 
So, sensibly, a zero rotation around any axis corresponds to the "zero unit Quaternion" (0, 0, 0, 1 XYZW), making it a useful default value for quaternions. But that does not help with choosing a default axis for the SFRotation value.
 
This will rarely matter. A use case may be when a SFRotation is initialized to the X3D default in a Proto but then only the angle is modified by a Proto script with the assumption that the axis is (0 0 1).
 
-Andreas


On Mon, Feb 10, 2025 at 12:57 PM Joe D Williams <joedwil at earthlink.net (mailto:joedwil at earthlink.net)> wrote:
not zerp,  zero

-----Original Message-----
From: Extensible 3D (X3D) Graphics public discussion <x3d-public at web3d.org (mailto:x3d-public at web3d.org)>
Sent: Feb 10, 2025 9:50 AM
To: Extensible 3D (X3D) Graphics public discussion <x3d-public at web3d.org (mailto:x3d-public at web3d.org)>, X3D Graphics public mailing list <x3d-public at web3d.org (mailto:x3d-public at web3d.org)>
Cc: Joe D Williams <joedwil at earthlink.net (mailto:joedwil at earthlink.net)>, Andreas Plesch <andreasplesch at gmail.com (mailto:andreasplesch at gmail.com)>
Subject: Re: [x3d-public] SFRotation default value spec. inconsistency

I think the 0 0 1 0 should be used everywhere for default axis-angle. 
I thinkI see 'zerp' unit quaternions (as in gltf as 0 0 0 1  XYZW) 
Thanks,
Joe


-----Original Message-----
From: Extensible 3D (X3D) Graphics public discussion <x3d-public at web3d.org (mailto:x3d-public at web3d.org)>
Sent: Feb 10, 2025 8:44 AM
To: X3D Graphics public mailing list <x3d-public at web3d.org (mailto:x3d-public at web3d.org)>
Cc: Andreas Plesch <andreasplesch at gmail.com (mailto:andreasplesch at gmail.com)>
Subject: Re: [x3d-public] SFRotation default value spec. inconsistency

The JS SAI spec. at https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#FieldServices
 
does not list functions for SFColorRGBA, only SFColor. There may be an earlier report. -Andreas


On Mon, Feb 10, 2025 at 11:31 AM Andreas Plesch <andreasplesch at gmail.com (mailto:andreasplesch at gmail.com)> wrote:
https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/fieldTypes.html#SFRotationAndMFRotation
 
specifies that (0 0 1 0) is the value of an uninitialized SFRotation given as (x y z a).
 
However, the JS SAI spec. in table 7.18 in https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#SFRotationInstanceCreationFunction
 
effectively makes (0 1 0 0) the default value if no parameters are provided.
 
The inconsistency does not have much of an impact since both are 0 rotations but I believe (0 1 0 0) - a 0 rotation around y - may have been intended as the default.
 
-Andreas
 
-- 
Andreas Plesch
Waltham, MA 02453




 

-- 
Andreas Plesch
Waltham, MA 02453







 

-- 
Andreas Plesch
Waltham, MA 02453




_______________________________________________
x3d-public mailing list
x3d-public at web3d.org (mailto:x3d-public at web3d.org)
http://web3d.org/mailman/listinfo/x3d-public_web3d.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250211/c289852f/attachment.html>


More information about the x3d-public mailing list