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

[fxtf-drafts] [geometry] WebGL API considerations

From: Joseph Orbegoso Pea via GitHub <sysbot+gh@w3.org>
Date: Thu, 15 Jun 2017 01:47:26 +0000
To: public-fxtf-archive@w3.org
Message-ID: <issues.opened-236055058-1497491245-sysbot+gh@w3.org>
trusktr has just created a new issue for https://github.com/w3c/fxtf-drafts:

== [geometry] WebGL API considerations ==
https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-tofloat32array

The following fails,

```js
gl.uniformMatrix4fv(worldMatrixLocation, false, new Float64Array([...]))
```

but the following works,

```js
gl.uniformMatrix4fv(worldMatrixLocation, false, new Float32Array([...]))
```

so then the following will fail

```js
const worldMatrix = new DOMMatrix([...])
gl.uniformMatrix4fv(worldMatrixLocation, false, worldMatrix.toFloat64Array())
```

but the following will work


```js
const worldMatrix = new DOMMatrix([...])
gl.uniformMatrix4fv(worldMatrixLocation, false, worldMatrix.toFloat32Array())
```

For example if it can accept an array,

```js
gl.uniformMatrix4fv(worldMatrixLocation, false, [...])
```

then I don't see a reason for it not to be able to also accept a `Float64Array` and convert it into the format that it needs.

Should we revise some other APIs that would be useful with DOMMatrix to make them easier to work with? Is `[geometry]` is the right place for this question?

Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/195 using your GitHub account
Received on Thursday, 15 June 2017 01:47:33 UTC

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