[x3d-public] SFRotation default value spec. inconsistency
Andreas Plesch
andreasplesch at gmail.com
Wed Feb 19 06:50:27 PST 2025
On Tue, Feb 18, 2025 at 10:16 AM Joe D Williams <joedwil at earthlink.net>
wrote:
> > ... may prefer the equivalent zero-rotation default value *0 1 0 0*
>
> ..
>
> Thanks Don. So the Transform rotation and Viewpoint orientation
>
> and any other use of rotation and orientation are treated as
>
> default zero when angle is zero, or, if all x, y, and z are zero.
>
Just a caution that
-
https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/fieldTypes.html#SFRotationAndMFRotation
says "The first three values specify a normalized rotation axis vector". So
x,y,z all zero is not a valid (illegal) SFRotation value.
-Andreas
>
>
> -----Original Message-----
> From: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>
> Sent: Feb 17, 2025 9:08 PM
> To: Andreas Plesch <andreasplesch at gmail.com>, Joseph D Williams <
> joedwil at earthlink.net>
> Cc: Extensible 3D (X3D) Graphics public discussion <x3d-public at web3d.org>
> Subject: Re: [x3d-public] SFRotation default value spec. inconsistency
>
>
> Thanks for discussion and for noticing the difference. Related references:
>
> - 19777-1 X3D ECMAScript language binding, clause 7 Function
> definitions, 7.6.6 SFRotation
> -
> https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#SFRotation
> - Table 7.18 — SFRotation instance creation functions
> -
> SFRotation
> (numeric x,
> numeric y,
> numeric z,
> numeric angle)
> x, y, and z are the axis of the rotation. angle is the angle of the
> rotation (in radians). Missing values default to 0.0, except y, which
> defaults to 1.0.
>
> - X3D Architecture, clause 5 Field type reference, 5.3.13 SFRotation
> and MFRotation
> -
> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/fieldTypes.html#SFRotationAndMFRotation
> - "The default value of an uninitialized SFRotation field is (0 0 1
> 0). The default value of an MFRotation field is the empty list."
>
> Yes they must be the same, so that X3D models are equivalent no matter
> what file encoding or programming-language binding are used.
>
> The X3D Architecture takes precedence. So we will change 19777-1 to match
> and the highlighted y above will become z.
>
> I too think that a default of (0 1 0 0) makes more sense, animation
> rotations are most often around the vertical (y) axis. However, the
> community has discussed this many times over the years. We always landed
> on (0 0 1 0) for backwards-compatibility reasons, not wanting to break
> legacy X3D and VRML models.
>
> Incidentally here is the X3D tooltips entry. Improvements and refinements
> always welcome.
>
> - X3D Tooltips: SFRotation
> - https://www.web3d.org/x3d/tooltips/X3dTooltips.html#SFRotation
> -
> SFRotation
> <https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/fieldTypes.html#SFRotationAndMFRotation>
> Single-Field rotation value using 3-tuple axis, radian angle form
> Default value *0 0 1 0*. Model authors and authoring tools may prefer
> the equivalent zero-rotation default value *0 1 0 0* since rotation
> about the vertical Y-axis is most common. Example values: 0 1 0 1.57
> *Warning:* initial 3-tuple axis vector cannot hold a zero-magnitude
> vector.
> *Warning:* comma characters within attribute values are not allowed,
> and do not pass strict validation.
> *Hint:* see Wikipedia: Radian <https://en.wikipedia.org/wiki/Radian>, Rotation
> matrix <https://en.wikipedia.org/wiki/Rotation_matrix> and Rotation
> formalisms in three dimensions
> <https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions>
> .
> XML Schema
> <https://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0_SFRotation.html>,
> X3D regexes
> <https://www.web3d.org/specifications/X3dRegularExpressions.html#SFRotation>,
> Java SAI
> <https://www.web3d.org/specifications/JavaLanguageBinding/Part2/nodeTypeInterfaces.html#SFRotation>,
> X3DJ
> <https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/fields/SFRotation.html>
>
>
> To keep track of this erratum, I have entered a new issue in the Mantis
> issue tracker.
>
> - Mantis 1488: (ECMAScript) 7.6.6 SFRotation default value needs to be
> (0 0 1 0)
> - https://mantis.web3d.org/view.php?id=1488
>
> I hope this make sense and sounds good.
>
> Have fun with X3D - or else!! 🙂
>
>
>
> all the best, Don
>
> --
>
> Don Brutzman Naval Postgraduate School, Code USW/Br
> brutzman at nps.edu
>
> Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA
> +1.831.656.2149
>
> X3D graphics, virtual worlds, navy robotics
> https://faculty.nps.edu/brutzman
>
>
>
> ------------------------------
> *From:* x3d-public <x3d-public-bounces at web3d.org> on behalf of Joe D
> Williams via x3d-public <x3d-public at web3d.org>
> *Sent:* Sunday, February 16, 2025 9:09 AM
> *To:* Andreas Plesch <andreasplesch at gmail.com>
> *Cc:* joedwil at earthlink.net <joedwil at earthlink.net>; X3D <
> x3d-public at web3d.org>
> *Subject:* Re: [x3d-public] SFRotation default value spec. inconsistency
>
>
> > I would vote for 0 1 0 0 since rotations around Y seem more common
>
>
>
> First,oldest use is in Part 1, way back to origin of VRML standard.
>
> Is Yaw really more popular or common than Pitch or Roll?
>
> For me, Please let's stick with oldest history and update more recent.
>
> Thanks
>
> Joe
>
>
>
>
>
> -----Original Message-----
> From: Andreas Plesch <andreasplesch at gmail.com>
> Sent: Feb 15, 2025 9:12 PM
> To: <joedwil at earthlink.net>
> Cc: Holger Seelig <holger.seelig at yahoo.de>, X3D <x3d-public at web3d.org>
> Subject: Re: [x3d-public] SFRotation default value spec. inconsistency
>
>
> I agree, probably the best default value for a unit quaternion is 0 0 0 1.
>
> However, X3D does not concern itself with quaternions, only axis-angle
> rotations.
>
> So the original question remains: Part 1 has axis-angle 0 0 1 0 as default
> while the JS SAI spec. has 0 1 0 0. Should both list the same default value
> ?
>
> If yes, which one ? I would vote for 0 1 0 0 since rotations around Y seem
> more common.
>
> -Andreas
>
> On Sat, Feb 15, 2025 at 11:04 PM <joedwil at earthlink.net> wrote:
>
> Doesn't this mean that the _best_ default value, for no rotation, is
> 'legally' for unit quaternion = 0 0 0 1
>
> because the square root of the sum of the squares of all four components
> does = 1 ?
>
> 0 0 0 0 would not be a legal unit quaternion.
>
> While the axis-angle default is 0 0 1 0 as appears in Part 1 is mostly for
> convenience
>
> since many value combinations can produce zero rotation?
>
> Also sure shows why axis-angle is so much easier to work with when typing
> numbers,
>
> pitch and yaw and roll for all.
>
> Thanks,
>
> Joe
>
>
>
> -----Original Message-----
> From: Andreas Plesch <andreasplesch at gmail.com>
> Sent: Feb 14, 2025 11:36 AM
> To: Holger Seelig <holger.seelig at yahoo.de>
> Cc: X3D <x3d-public at web3d.org>, Joseph D Williams <joedwil at earthlink.net>
> Subject: Re: [x3d-public] SFRotation default value spec. inconsistency
>
>
> Let me just add for clarity that the length (or norm) of a quaternion
> includes the fourth, the scalar component. The norm is the square root of
> the sum of the squares of all four components.
>
> Only unit quaternions represent rotations. A (0,0,0,0) quaternion does not
> represent any rotation (but of course exists outside of rotations).
>
> Andreas
>
> PS: To add back in some fuzziness, a unit quaternion can only represent a
> rotation up to 360 degrees. I think there is a mechanism to use non-unit
> quaternions for larger rotations.
>
> On Fri, Feb 14, 2025 at 10:22 AM Holger Seelig <holger.seelig at yahoo.de>
> wrote:
>
> All quaternions must be normalized to be a legal rotation, so the length
> of the quaternion must always be one.
>
> Holger
> --
> Holger Seelig
> Leipzig, Germany
>
> holger.seelig at yahoo.de
> https://create3000.github.io/x_ite/
>
> Am 14.02.2025 um 15:38 schrieb Joe D Williams via x3d-public <
> x3d-public at web3d.org>:
>
> > So, sensibly, a zero rotation around any axis corresponds to the "zero
> unit Quaternion" (0, 0, 0, 1 XYZW),
>
>
> Right. Not sure but 0 0 0 0 for unit quaternion might not be legal. I
> think the values must compute to1 to be legal?
> Thanks,
> Joe
>
>
>
>
>
> -----Original Message-----
> From: Andreas Plesch <andreasplesch at gmail.com>
> Sent: Feb 10, 2025 12:37 PM
> To: Joe D Williams <joedwil at earthlink.net>
> Cc: Extensible 3D (X3D) Graphics public discussion <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>
> wrote:
>
> not zerp, zero
>
> -----Original Message-----
> From: Extensible 3D (X3D) Graphics public discussion <x3d-public at web3d.org
> >
> Sent: Feb 10, 2025 9:50 AM
> To: Extensible 3D (X3D) Graphics public discussion <x3d-public at web3d.org>,
> X3D Graphics public mailing list <x3d-public at web3d.org>
> Cc: Joe D Williams <joedwil at earthlink.net>, Andreas Plesch <
> 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
> >
> Sent: Feb 10, 2025 8:44 AM
> To: X3D Graphics public mailing list <x3d-public at web3d.org>
> Cc: Andreas Plesch <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>
> 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
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
>
> --
> Andreas Plesch
> Waltham, MA 02453
>
>
>
>
>
> --
> Andreas Plesch
> Waltham, MA 02453
>
>
>
>
>
--
Andreas Plesch
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250219/e9e1dfcd/attachment-0001.html>
More information about the x3d-public
mailing list