[fxtf-drafts] [geometry] DOMMatrix/DOMMatrix could use more methods and helpers.

trusktr has just created a new issue for https://github.com/w3c/fxtf-drafts:

== [geometry] DOMMatrix/DOMMatrix could use more methods and helpers. ==
https://drafts.fxtf.org/geometry/#ref-for-dom-dommatrixreadonly-flipy-1

>     [NewObject] DOMMatrix inverse();

There's currently an `inverse()` method.

But it would be nice to also have a `transpose()` method. This can be useful, for example, for calculating lighting normals on scaled objects. Here's an example of the technique using a custom `m4` matrix library:

```js
            // for correct lighting normals
            const worldInverseTransposeMatrix = m4.transpose(m4.inverse(worldMatrix))
            gl.uniformMatrix4fv(worldInverseTransposeMatrixLocation, false, worldInverseTransposeMatrix)
```

It would be great to be able to do the same with DOMMatrix classes.

There could possible also be static methods for creating common types of matrices, for example:

```js
const perspectiveMatrix = DOMMatrix.perspective(fieldOfView, aspectRatio, near, far)
```

Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/194 using your GitHub account

Received on Wednesday, 14 June 2017 19:17:04 UTC