Re: [geometry] order of arrays

On Wed, Jun 11, 2014 at 10:26 PM, Dirk Schulze <dschulze@adobe.com> wrote:

>
> On Jun 12, 2014, at 7:15 AM, Rik Cabanier <cabanier@gmail.com> wrote:
>
> > All,
> >
> > the current spec says that arrays are in [1] column-major order, but it
> seems that WebGL is in row-major order (ie [2]).
> > Can people confirm this? If so, maybe we should update the spec to match.
>
> The spec aims to match CSS Transforms which is column-major order[1]. CSS
> Transforms is also the reason why the indices on the matrix elements seem
> to be the wrong way around… at least compared to mathematical conventions.
>
> It is indeed the question what will be used more. Maybe we can add an
> enumeration enum DOMMatrixOrder { ‘column’, ‘row’ } as argument for
> constructor, getters and setters? What would be the default, still ‘column'?
>

Well, if CSS already specified it in column order, we should just offer
that.
It's easy enough to swap the elements yourself. Maybe this should be a note
in the spec?


> [1] http://dev.w3.org/csswg/css-transforms/#funcdef-matrix3d
>
> >
> > 1: http://dev.w3.org/fxtf/geometry/#dom-dommatrixreadonly-tofloat32array
> > 2: https://github.com/evanw/lightgl.js/blob/master/src/matrix.js
>
>

Received on Thursday, 12 June 2014 06:13:50 UTC