W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Re: API for matrix manipulation

From: Chris Marrin <cmarrin@apple.com>
Date: Tue, 15 Mar 2011 17:00:07 -0700
Cc: "public-webapps@w3.org" <public-webapps@w3.org>
Message-id: <5BCFE701-9684-40F7-AF60-3E470625B29F@apple.com>
To: Joćo Eiras <joao.eiras@gmail.com>

On Mar 14, 2011, at 6:54 PM, Joćo Eiras wrote:

> 
>>> Comments or is something already being worked on ?
>> 
>> There are already 2 such classes: SVGMatrix and CSSMatrix. The former is an affine transformation matrix (commonly misnamed a "2x3 matrix") and the latter is a 3D homogeneous transformation matrix (commonly correctly named a "4x4 matrix").
>> 
> 
> Are those classes in their current implementations thread-safe ? Could a Web Worker easily do matrix calculations with them ? I would guess a basic physics engine in a worker would be a nice use case.

They are as thread safe as any other JavaScript classes, which is not at all :-)

As I understand it, the data would have to be serialized to be sent between Workers and the main thread.

> 
> And what about making something that is generic enough for both SVG and CSS, or even full blown algebra ? And then specify bindings of implicit conversions from those DOM classes into a basic ES matrix (if you would like to call it that) ?

Proposing a Matrix class in JavaScript is much different than adding classes to the browser to support the DOM API, which is what SVGMatrix and CSSMatrix are. I think it would be nice to unify the classes somehow. But that might be difficult since SVG and CSS are (necessarily) separate specs. But maybe one of the API gurus has a solution?

-----
~Chris
cmarrin@apple.com
Received on Wednesday, 16 March 2011 00:00:40 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:43 GMT