[x3d-public] Euler rotation

Leonard Daly Leonard.Daly at realism.com
Mon Jan 7 12:01:27 PST 2019


Hi Albert et al,

Another option (at least for user-friendly representations) would be to 
use converter symbology in the field definition. For example, right now 
rotations are represented by

/normalized-vector angle/

where /normalized-vector/ is a 3-space vector that has been normalized 
that represents the axis of rotation; and /angle/ is the angle of rotation.

A set of symbolic converter functions could be specified that allowed 
the user to specify the rotation is a number of different manners. These 
functions would accept the rotation values and convert them into a 
standardized internal form (or default input form, depending on the 
particular browser).

For example, converter functions could be defined for Axis-Angle 
(default), Euler, and Quaternion. The rotation formats would then be 
equivalent.

     AXIS-ANGLE (normalized-vector angle)
     EULER (angleX angleY angleZ)
     QUATERNION (qw qx qy qz)

All would be legal rotation field values and would convert to the same 
internal format.

This would work when the X3D encoding was string based (XML or Classic 
VRML). The binary encoding would need to process the input (which 
converts do now) to a standard/default format.

This allows the user interface encoding to specify something that is 
clear and nice to the user; while maintaining a standardized internal 
format. Note that the function name is part of the value, so changing 
the value would require a function (or use of the default).

I implemented this in XSeen, though it hasn't documented yet. In 
addition to rotations, I use something similar for colors (fractional, 
value (decimal), byte (hex), labeled (white, red, green, etc.)). For 
both of these, I drew my inspiration from CSS and their specification of 
colors and other data values.

Essentially all of the fundamentals of X3D were taken from VRML, which 
was taken from OpenGL pre-1997 with a number of features added from 
those long-ago years. Computation was expensive then so user-niceties 
were sometimes compromised in favor of efficiencies.


Leonard Daly


> "So the term euler would replace the term rotation and also be a 
> different datatype than rotation"
>
> Yes, 'euler' would be complementary, an alternative way, to set the 
> initial orientation. To avoid Gimbals lock, one should of course use 
> quaternions for dynamic rotations.
>
> I think the sequence of the individual numbers for the angles and 
> their sign should correspond to the x y z axes as defined by X3D. I 
> don't really have an opinion on the yaw, pitch roll terms: -z seems a 
> natural gaze direction for this.
>
> Albert Jan  Wonnink
>
> ------------------------------------------------------------------------
> *Van:* x3d-public <x3d-public-bounces at web3d.org> namens 
> x3d-public-request at web3d.org <x3d-public-request at web3d.org>
> *Verzonden:* maandag 7 januari 2019 14:44
> *Aan:* x3d-public at web3d.org
> *Onderwerp:* x3d-public Digest, Vol 118, Issue 15
> Send x3d-public mailing list submissions to
>         x3d-public at web3d.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> or, via email, send a message with subject or body 'help' to
>         x3d-public-request at web3d.org
>
> You can reach the person managing the list at
>         x3d-public-owner at web3d.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of x3d-public digest..."
>
>
> Today's Topics:
>
>    1. Re: Euler rotation (Joseph D Williams)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 7 Jan 2019 05:43:28 -0800
> From: Joseph D Williams <joedwil at earthlink.net>
> To: Albert Jan Wonnink <awonnink at hotmail.com>, John Carlson
>         <yottzumm at gmail.com>, "vmarchetti at kshell.com"
>         <vmarchetti at kshell.com>,  X3D-Public <x3d-public at web3d.org>
> Subject: Re: [x3d-public] Euler rotation
> Message-ID: <E1ggVBd-0003vy-Se at elasmtp-curtail.atl.sa.earthlink.net>
> Content-Type: text/plain; charset="utf-8"
>
> From: Albert Jan Wonnink
> Sent: Monday, January 7, 2019 2:03 AM
> To: John Carlson; Joseph D Williams; vmarchetti at kshell.com; X3D-Public
> Subject: Re: [x3d-public] Euler rotation
>
> ? Hi Joseph,
>
> ? Thank you for your reply. Just to be sure: the context I meant to 
> discuss is about having a convenient attribute in the declarative 
> syntax, say 'euler', to set the initial orientation of the transform, 
> so anyone can use either 'rotation' or 'euler'.
> ?
> ? <transform euler="20 40 10" >
> ?
>
> Fine, Albert,
> So the term euler would replace the term rotation and also be a 
> different datatype than rotation?
> The important technical and usage detail is accepting quaternions 
> since probably the preferred internal form.
> The main thing about degrees is that they won?t always work. That is 
> why Euler moved on. If you are making video frames, then maybe ok to 
> author or capture frame data in degrees but when you want to have some 
> realtime or variabletime fun, then interpolation may not operate as 
> expected or at all.
>
> ? So I interpreted Vince's $yaw, $pitch and $roll to be just 
> placeholders, for manual substitution.?
>
> Thoughts about the use of pitch yaw roll names for the x y z 
> rotation/orientation axes?
> Just as a memory aid of course.
> I described it as I found it in viewpoint where the default is gaze -z 
> and hanim joint animations where the default is gaze +z.
>
> ? You are right using this with either radians or degrees would be 
> equally simple.?
>
> Most simple and reliable using the x3d form thinking with radians, no 
> doubt.  The x3d recognition of quaternions would improve x3d 
> capability by being even more simple and reliable and also giving 
> improved level of validation for rotation and orientation values.
>
>
> ? Regards,
> ? Albert Jan?
>
> Thanks for the thoughts,
> Joe
>
> ?
>
> ??
> From: Joseph D Williams
> Sent: Sunday, January 6, 2019 7:20 PM
> To: Albert Jan Wonnink; vmarchetti at kshell.com; X3D-Public
> Subject: Re: [x3d-public] Euler rotation
> ?
> Hi Albert and All,
> When you use euler (or Tait-Bryan) angles for a while you will find 
> that you get problems.
> Actually there is plenty of writing about the details maybe even in 
> the x3d or hanim archives and widely on the web.
> ?
> In addition, when you create or edit the things much then you will 
> find it is actually a lot easier to use quats or axis-angle radians. 
> In general, for degrees, maybe your editing system may offer as a 
> learning tool if radian is really an elementary block to learning, but 
> really, never in the user code due to misleading simplicity and what 
> ?cha finally gonna tell ?em when the gimbals lock?
> ?
> ? <Transform DEF="yaw-rotation" rotation="0 0 1 $yaw">
> ? <Transform DEF="pitch-rotation" rotation="0 1 0 $pitch">
> ? <Transform DEF="roll-rotation" rotation="1 0 0 $roll">
> ?
> Besides the fact that a variable is not allowed there
> (maybe use a prototype if you need a variable?)
> I don't think your naming of yaw and pitch and roll is reasonable for 
> x3d.
> ?
> For default transform rotation 0 0 1 0, sit on it and face +z and find 
> +y is up and +x is left.
> then fly the thing using pitch and yaw and roll.
> The x3d axis-angle parameters are most likely pitch yaw roll then the 
> scale,
> and I think the same order for quaternions, except where the 'scale' 
> is placed and the special limits for values.
> ?
> Why not try the following:
> ?
> DEF Pitch OrientationInterpolator {
> key [ 0, 0.25 0.5, 0.75 1 ]
> keyValue [ 0 0 1 0, 1 0 0 1.5, 0 0 1 0, -1 0 0 1.5, 0 0 1 0 ] }
> ?
> DEF Yaw OrientationInterpolator { key [ 0, 0.25 0.5, 0.75 1 ]
> keyValue [ 0 0 1 0, 0 1 0 1.5, 0 0 1 0, 0 -1 0 1.5, 0 0 1 0 ] }
> ?
> DEF Roll OrientationInterpolator {
> key [ 0, 0.25 0.5, 0.75 1 ]
> keyValue [ 0 0 1 0, 0 0 1 1.5, 0 0 1 0, 0 0 1 1.5, 0 0 1 0 ] }
> ?
> Thanks and Best,
> Joe
> ?
> From: Albert Jan Wonnink
> Sent: Sunday, January 6, 2019 2:25 PM
> To: vmarchetti at kshell.com; X3D-Public
> Subject: Re: [x3d-public] Euler rotation
> ?
> Thanks Vince, for your reply.?
> ?
> As long as the angles and X3D code is? generated by code one can of 
> course easily calculate the individual parameters for a quaternion. 
> But during the testing of our experimental Unity based browser, and 
> preparing scenes for that, I found it very easy to extend the 
> transform specification with a degree-based Euler attribute 
> (Tait-Bryan would also have worked).
> ?
> The current system still makes it relatively difficult to manually 
> apply an angle of the most used fractions of PI, doesn't it?
> ?
> I guess this issue must have been discussed in one of the early days 
> of the X3D specification. But it seems to me a lost chance to make it 
> more convenient.
> ?
> Regards
> ?
> ?
> Albert Jan Wonnink
> ?
> ?
>
> Van: vmarchetti at kshell.com <vmarchetti at kshell.com>
> Verzonden: zondag 6 januari 2019 22:49
> Aan: Albert Jan Wonnink; X3D-Public
> Onderwerp: Re: [x3d-public] Euler rotation
> ?
> There is no single node Euler angle alternative representation of a 
> rotation transform defined in the current (v 3.3) X3D standard.
> ?
> You can get an easier to edit representation of Euler angle rotation 
> (specifically the Tait-Bryan 
> angles,?https://en.wikipedia.org/wiki/Euler_angles#Tait%E2%80%93Bryan_angles, 
> commonly used for vehicle oriented
> with respect to the horizon, by nesting 3 Transforms:
> ?
> <Transform DEF="yaw-rotation" rotation="0 0 1 $yaw">
> <Transform DEF="pitch-rotation" rotation="0 1 0 $pitch">
> <Transform DEF="roll-rotation" rotation="1 0 0 $roll">
> <!-- put vehicle model here -->
> <Shape>...</Shape>
> </Transform>
> </Transform>
> </Transform>
> ?
> where for $yaw, $pitch, $roll you need to substitute the numerical 
> value of the rotation angle in radians.
> ?
> ?
> Vince Marchetti
> ?
> On Jan 6, 2019, at 12:53 PM, Albert Jan Wonnink <awonnink at hotmail.com> 
> wrote:
> ?
> Is there, or should there be, an Euler alternative for the transform 
> 'rotation' property? This makes direct x3d code editing much easier.
> ?
> Regards,
> ?
> ?
> Albert Jan Wonnink?
> _______________________________________________
> x3d-public mailing list
> 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/20190107/b500d676/attachment.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: 9B68D1D68F1247D1A07F4C368D0D7215.png
> Type: image/png
> Size: 156 bytes
> Desc: not available
> URL: 
> <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190107/b500d676/attachment.png>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
> ------------------------------
>
> End of x3d-public Digest, Vol 118, Issue 15
> *******************************************
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org


-- 
*Leonard Daly*
3D Systems & Cloud Consultant
LA ACM SIGGRAPH Past Chair
President, Daly Realism - /Creating the Future/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190107/1ee4e273/attachment-0001.html>


More information about the x3d-public mailing list