[X3D-Public] JavaScript: Question to SFMatrix3f.set/getTransform
Holger Seelig
holger.seelig at yahoo.de
Mon Oct 20 19:56:00 PDT 2014
Yes a reference implementation would be fine. But a change to a scalar is not posible as you cannot pass a scalar by reference in JavaScript. With getTransform you must pass all arguments by reference. Or better said, you must pass objects, the implementor of this function can then assign the values.
Von Samsung Mobile gesendet
<div>-------- Ursprüngliche Nachricht --------</div><div>Von: doug sanden <highaspirations at hotmail.com> </div><div>Datum:21.10.2014 04:20 (GMT+01:00) </div><div>An: x3d-public at web3d.org </div><div>Betreff: Re: [X3D-Public] JavaScript: Question to SFMatrix3f.set/getTransform </div><div>
</div>Perhaps there is a reference implementation, committee notes to explain, or perhaps the design should be changed to a scalar rotation.
-doug
> Date: Mon, 20 Oct 2014 21:13:46 +0200
> From: holger.seelig at yahoo.de
> To: x3d-public at web3d.org
> Subject: Re: [X3D-Public] JavaScript: Question to SFMatrix3f.set/getTransform
>
> No, this cannot be right Doug. The point about which the rotation occurs
> is the translation/origin of the matrix3 and the translation is the
> first argument to get/setTransform:
>
> A matrix3 consists of 4 values: translation, rotation, scale,
> scaleOrientation. Let's look how it works: A coordinate system with two
> orthogonal axes x, and y that have both a length of one is translate by
> »translation« to an arbitary place. Then the coordinate system or better
> the two axes are scaled, mostly independently, by muliplying by an
> amount. Then the coordinate system is rotated by an amount about the
> origin (which is the translation), in 2d this rotation value is normally
> a simple number, the angle, in degrees or radians, we could express this
> rotation also as complex number.
>
> Let's take a simple float number as rotation phi we can construct a
> rotation matrix3 as follow:
>
> Convension: matrix3 organized in row-major fashion:
> x-axis 0
> y-axis 0
> x y 1
>
> cos (phi) sin (phi) 0
> -sin (phi) cos (phi) 0
> 0 0 0
>
> The first two numbers in the third row of a matrix3 is the translation,
> and this is the point about which the rotation occurs.
>
>
> Am 20.10.2014 um 19:29 schrieb doug sanden:
> >
> > My guess/hypothesis: Matrix3 2D rotation SFVec3f = (x,y,angle)
> > - where x,y is the 2D point about which the rotation occurs(?)
> > (don't compute rotation from xy)
> > I base that on my hypothesis the designers were attempting to make Matrix3 analogous to Matrix4.
> > See also the documentation on Transform node for how to apply scaleOrientation for 3D, which takes a series of steps.
> >
> > ________________________________
> >> Date: Mon, 20 Oct 2014 19:05:15 +0200
> >> Subject: AW: Re: [X3D-Public] JavaScript: Question to
> >> SFMatrix3f.set/getTransform
> >> From: holger.seelig at yahoo.de
> >> To: highaspirations at hotmail.com; x3d-public at web3d.org
> >>
> >> A matrix3 is coordinate system in 2d space, that has a origin (the
> >> translation) and a rotation and a scale and scaleOrientation. You Doug
> >> says, the first two values of the SFVec3f should be the complex number
> >> of the rotation, from that complex number I can calculate an angle.
> >> Should this be the third value?
> >>
> >>
> >> Von Samsung Mobile gesendet
> >>
> >>
> >> -------- Ursprüngliche Nachricht --------
> >> Von: doug sanden
> >> Datum:20.10.2014 18:49 (GMT+01:00)
> >> An: x3d-public at web3d.org
> >> Betreff: Re: [X3D-Public] JavaScript: Question to SFMatrix3f.set/getTransform
> >>
> >> I think matrix3 is a 2D homogenous transform, much like matrix4 is a 3D
> >> homogenous transform. For 3D a rotation has 4 values: a 3D direction
> >> vector for the axis of rotation, and 4th value for the rotation angle
> >> about that axis.
> >> For matrix3 (2D), there would be something analogous, but with one less
> >> dimension. Likely 2 values xy for a point of rotation, and a 3rd value
> >> for the angle of rotation about that point. scale orientation in 2D
> >> would need a point and rotation.
> >> -Doug
> >>
> >>
> >> ----------------------------------------
> >>> Date: Mon, 20 Oct 2014 18:34:28 +0200
> >>> From: holger.seelig at yahoo.de
> >>> To: x3d-public at web3d.org
> >>> Subject: [X3D-Public] JavaScript: Question to SFMatrix3f.set/getTransform
> >>>
> >>> I cannot figure out what are the second and fourth argument of
> >>> SFMatrix.getTransform are, the spec says:
> >>>
> >>> SFMatrix3f .setTransform setTransform (SFVec2f translation,
> >>> SFVec3f rotation,
> >>> SFVec2f scale,
> >>> SFVec3f scaleOrientation,
> >>> SFVec2f center)
> >>>
> >>> I can see that a SFVec3f should be used for the rotation arguments, but
> >>> I don't know what the three values (x,y,z) stand for. To my
> >>> understanding like the TexureTransform node a matrix3 rotation is only a
> >>> simple float. I know that simple numbers cannot be passed by value to a
> >>> JavaScript function.
> >>>
> >>>
> >>> --
> >>> Holger Seelig
> >>> Mediengestalter Digital – Digital Media Designer
> >>>
> >>> Scheffelstraße 31a
> >>> 04277 Leipzig
> >>>
> >>> Telefon: 01577 147 26 11
> >>> E-Mail: holger.seelig at yahoo.de
> >>>
> >>> _______________________________________________
> >>> X3D-Public mailing list
> >>> X3D-Public at web3d.org
> >>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> >>
> >> _______________________________________________
> >> X3D-Public mailing list
> >> X3D-Public at web3d.org
> >> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> >
> > _______________________________________________
> > X3D-Public mailing list
> > X3D-Public at web3d.org
> > http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> >
>
>
> --
> Holger Seelig
> Mediengestalter Digital – Digital Media Designer
>
> Scheffelstraße 31a
> 04277 Leipzig
> Germany
>
> Cellular: +49 1577 147 26 11
> E-Mail: holger.seelig at yahoo.de
> Web: http://titania.create3000.de
>
> _______________________________________________
> 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/20141021/668750dd/attachment-0001.html>
More information about the X3D-Public
mailing list