W3C home > Mailing lists > Public > public-fxtf-archive@w3.org > June 2017

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

From: Joseph Orbegoso Pea via GitHub <sysbot+gh@w3.org>
Date: Wed, 14 Jun 2017 19:16:58 +0000
To: public-fxtf-archive@w3.org
Message-ID: <issues.opened-235982139-1497467816-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 November 2018 00:45:59 UTC