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. ==

>     [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:

            // 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:

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.4.0 : Friday, 17 January 2020 19:50:21 UTC